SHARE

Yo ninjas, in this jQuery tutorial, I’ll show you how we can traverse up and down the DOM with a few cool and easy jQuery methods.

jQuery essentially wraps an API layer around the DOM, giving us access to these new methods, making our lives as JavaScript developers much much easier :).

SUBSCRIBE TO CHANNEL – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg?sub_confirmation=1

========== JavaScript for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9i9Ae2D9Ee1RvylH38dKuET

========== CSS for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9gQeDH6xYhmO-db2mhoTSrT

========== HTML for Beginners Playlist ==========

https://www.youtube.com/playlist?list=PL4cUxeGkcC9ibZ2TSBaGGNrgh4ZgYE6Cc

========== The Net Ninja ============

For more front-end development tutorials & to black-belt your coding skills, head over to – https://www.youtube.com/channel/UCW5YeuERMmlnqo4oq8vwUpg or http://thenetninja.co.uk

========== Social Links ==========

Twitter – @TheNetNinja – https://twitter.com/thenetninjauk

5 COMMENTS

  1. In terms of the .closest() method: You gave an example in which the closest wrapper was above "#social-nav". If there were a wrapper beneath "#social-nav", which in this case would be closer, would the .closest() method recognize the wrapper beneath it as it is closer? Or does the .closest() method only work upward?

  2. {
    $("img[alt=map]").css({border:"3px solid brown"});

    $("#contact-methods").next().css({border:"3px solid brown"}):

    $("#csocial-nav").prev().css({border:"3px solid brown"}):
    }
    what is the difference between above codes???….all have similar outputs…

  3. for the last one, so it finds closest parents of ".wrapper", not "#social-nav"? what if I just type $(".wrapper").closest()?

LEAVE A REPLY

Please enter your comment!
Please enter your name here