From kodeboard, 4 Years ago, written in HTML5.
Embed
  1. $.fn.exists = function(){return this.length>0;}
  2.  
  3. if ($(selector).exists()) {
  4.     // Do something
  5. }

You must login to reply or comment on this code.