Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How to use “this” in jQuery?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37739
    jcoder
    Member

    Hi All,

    Just trying to figure out how to use the “this” selector in jQuery. I am looking for when one li item is clicked that word changes rather than all of them like they are doing right now. My code is below.

    Update:
    The solved code is on my CodePen page http://codepen.io/jbatzel1/pen/this/11


    • Yeti Mountain Bikes

    • Gary Fisher Mountain Bikes

    • Iron Horse Mountain Bikes




    • GT Mountain Bikes

    • Trek Mountain Bikes

    • Specialized Mountain Bikes

    $(".bike1").click(function(){
    $(this).html("Mountain Bikes");
    });
    #105409
    jcoder
    Member

    Figured it Out!

    #105410
    nhereveri
    Member

    Thanks for your input. Please indicate the topic as solved. This will improve visibility in the list of forum items and we go to avoid resolving the issue, as when making a rhetorical question.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.