Posted By

kreamweb on 11/22/10


Tagged

jquery tips


Versions (?)

jQuery Selector


 / Published in: JavaScript
 

  1. // Chaining
  2. $('div.signup').css('opacity', 0.4).show('slow').addClass('special');
  3.  
  4. // Chaining on multiple lines
  5. $('div.signup')
  6. .css('opacity', 0.4)
  7. .show('slow')
  8. .addClass('special');
  9.  
  10.  
  11. //per selezionare l'immagina con il titolo "elefante"
  12. $('img[title="elephant"]').
  13.  
  14. //first child selector
  15. $("ul li:first-child").
  16.  
  17. //last child selector
  18. $("ul li:last-child").
  19.  
  20. //se si vogliono selezionare tutti i link tranne quelli con class comments_link
  21. $("a :not(.comments_link)").

Report this snippet  

You need to login to post a comment.