This functions returns value 1 if var has some value and 0 when var is not present
jQuery.fn.exists = function(){return this.length>0;}
if ($(selector).exists()) {
// Do something
}
No comments:
Post a Comment