Posted By

HubertGaulin on 04/08/09


elements selection examples

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Elements selection in jQuery

 / Published in: jQuery


  1. jQuery('div.panel')
  2. All divs with class=“panel”
  3. jQuery('p#intro')
  4. The paragraph with id=“intro”
  5. jQuery('div#content a:visible')
  6. All visible links inside the div with id=“content”
  7. jQuery('input[@name=email]')
  8. All input fields with name=“email”
  9. jQuery('table.orders tr:odd')
  10. “odd” numbered rows in a table with class “orders”
  11. jQuery('a[@href^="http://"]')
  12. All external links (links that start with http://)
  13. jQuery('p[a]')

Report this snippet  

You need to login to post a comment.