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 2

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 2: Selector Expressions

You got me lookin' up high
You got me searchin' down low
    —Devo, "Jerkin' Back 'n' Forth"

Borrowing from CSS 1–3 and basic XPath, and then adding its own, jQuery offers a powerful set of selector expressions for matching a set of elements in a document. In this chapter, we'll examine every selector expression that jQuery makes available in turn.

Chapter 2: Selector Expressions

  • CSS Selectors
    • Element: T
    • ID: #myid
    • Class: .myclass
    • Descendant: E F
    • Child: E > F
    • Adjacent Sibling: E + F
    • General Sibling: E ~ F
    • Multiple Elements: E,F,G
    • Nth Child (:nth-child(n))
    • First Child (:first-child)
    • Last Child (:last-child)
    • Only Child :only-child
    • Not :not(s)
    • Empty :empty
    • Universal: *
  • XPath Selectors
    • Descendant: E//F
    • Child: E/F 26 Parent: E/..
    • Contains: [F]
  • Attribute Selectors
    • Has Attribute: [@foo]
    • Attribute Value Equals: [@foo=bar]
    • Attribute Value Does Not Equal: [@foo!=bar]
    • Attribute Value Begins: [@foo^=bar]
    • Attribute Value Ends: [@foo$=bar]
    • Attribute Value Contains: [@foo*=bar]
  • Form Selectors
  • Custom Selectors
    • Even Element (:even) Odd Element (:odd)
    • Nth Element (:eq(n), :nth(n))
    • Greater Than :gt(n)
    • Less Than : lt(n)
    • First :first
    • Last :last
    • Parent :parent
    • Contains :contains(text)
    • Visible :visible
    • Hidden :hidden

 

   

 

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