Posted By

nerdfiles on 11/20/09


Tagged

javascript jquery extend


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

YA
jannisg
rygiel


IfExists (jQuery)


 / Published in: jQuery
 

  1. Function:
  2. jQuery.fn.exists = function() { return (this.length > 0); };
  3.  
  4. // if($('#object').exists())
  5.  
  6. Chaining:
  7. jQuery.fn.IfExists = function() { if(this.length > 0) return this; };

Report this snippet  

You need to login to post a comment.