Posted By

jmacgr on 01/12/10


Tagged

jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jmacgr


How to check whether an element exists using jQuery


 / Published in: JavaScript
 

URL: http://www.aaronrussell.co.uk/blog/check-if-an-element-exists-using-jquery/

  1. if ($("#mydiv").length > 0){
  2. // do something here
  3. }

Report this snippet  

You need to login to post a comment.