Elements selection in jQuery

/ Published in: jQuery
Save to your folder(s)

Copy this code and paste it in your HTML
  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]')

URL: http://simonwillison.net/2007/Aug/15/jquery/

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.