jQuery Reference Guide: A Comprehensive Exploration of the Popular JavaScript Library
www.PACKTPUB.com  FREE ONLINE EDITION: Read full chapters online, download free samples from the book and more...
Book Contents Index > Chapter 3

Preface

1: Anatomy of a jQuery Script Free Chapter
2: Selector Expressions
3: DOM Traversal Methods
4: DOM Manipulation Methods
5: Event Methods
6: Effect Methods
7: AJAX Methods
8:
Miscellaneous Methods  
9: Plug-In API
10:
Dimensions Plug-In
11: Form Plug-In


Appendix A: Online Resources

Appendix B: Development Tools


Index

Latest Updates

Free Chapter:
Chapter 1: Anatomy of a jQuery Script [713 KB PDF]

Contact us

 

 

 

 

 

Chapter 3: DOM Traversal Methods

Cause there's a train coming into the station
But it's heading for a new destination
    —Devo, "It Doesn't Matter to Me"

In addition to the selector expressions described in Chapter 2, jQuery has a variety of DOM traversal methods to help us select elements in a document. These methods offer a great deal of flexibility, even allowing us to act upon multiple sets of elements in a single chain, like so:

$('div.section > p').addClass('lit').lt(1).addClass('profound');

At times the choice between a selector expression and a corresponding DOM traversal method is simply a matter of taste, but there is no doubt that the combined set of expressions and methods makes for an extremely powerful toolset for getting anything we want.

Chapter 3: DOM Traversal Methods

  • The jQuery Factory Function
  • $()
  • Filtering Methods
    • .filter()
    • .not()
    • .contains()
    • .eq()
    • .lt()
    • .gt()
  • Tree Traversal Methods
    • .find()
    • .children()
    • .parents()
    • .parent()
    • .siblings()
    • .prev()
    • .next()
  • Miscellaneous Traversal Methods
    • .add()
    • .is()
    • .end()

 

   

 

Paperback 225 pages
Released: July 2007
ISBN: 1847193811
ISBN 13:
978-1-847193-81-0

     

 




View the book details
on PacktPub.com

 


 
  This website is owned and maintained by Packt Publishing Ltd, 2007. All rights reserved. Terms and Conditions