Posted By

digitalclubb on 12/13/10


Tagged

jquery function exists


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

AtticBoy
kikuchiyosesa


Create exists function in jQuery


 / Published in: jQuery
 

Great way to check if a node exists before running a piece of code.

  1. (function($) { $.fn.extend({ exists: function() {return this.length>0;} }); })(jQuery)

Report this snippet  

You need to login to post a comment.