Posted By

reynish on 08/24/10


Tagged


Versions (?)

if element has class


 / Published in: jQuery
 

URL: http://www.kavoir.com/2009/04/jquery-how-to-check-if-an-element-has-a-particular-class.html

Found this, very useful

  1. if ($(#elm).is('.first')) {
  2. //#elm has the class
  3. } else {
  4. //#elm doesn't have the class
  5. }

Report this snippet  

You need to login to post a comment.