How to Transverse DOM in JQuery

Goud.Kv
Posted by Goud.Kv under jQuery category on | Points: 40 | Views : 814
Below code explains about Transversing the DOM in JQuery.

$("div#home").prev("div");

// find the div previous in relation to the current div

$("div#home").next("ul");

// find the next ul element after the current div

$("div#home").parent();

// returns the parent container element of the current div

$("div#home").children("p");

// returns only the paragraphs found inside the current div

Comments or Responses

Login to post response