Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Ajax Jquery Miscellaneous Traversing

Related Tutorials


 
 

Share on Google+Share on Google+

Miscellaneous Traversing

Advertisement
This page discusses - Miscellaneous Traversing

Miscellaneous Traversing

     

Miscellaneous Traversing

Miscellaneous Traversing have following method :

.add()

This method add elements to the set of matched element.

Example :

$("p").add("span").css("background", "yellow")

.andSelf()

This method add the previous selection to the current selection.

Example :

$("div").find("p").andSelf().addClass("border");

.contents()

This method find all the child nodes inside the matched elements (including text nodes), or the content document, if the element is an iframe.

Example :

$("p").contents().filter(function(){ return this.nodeType != 1; }).wrap("<b/>");

.end()

This method ends the most recent filtering operation in the current chain and return the set of matched elements to its previous state.

Example :

<script>$("p").find("span").end().css("border", "2px red solid");</script>

This method selects all paragraphs, finds span elements inside these, and reverts the selection back to the paragraphs.

Learn from experts! Attend jQuery Training classes.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 18, 2011

Related Tutorials

Discuss: Miscellaneous Traversing  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com