jquery attribute selectors


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



Copy this code and paste it in your HTML
  1. $('img[src]')
  2.  
  3. $('img[src=test.gif]')
  4.  
  5. $('img[src^=test]') // starts with test
  6.  
  7. $('img[src$=gif]') // ends with "gif"
  8.  
  9. $('img[src*=test]') // contains
  10.  
  11. $('img[src^=test][src$=gif]') // starts wit "test" ends with "gif"

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.