Monday 2 January 2017

Create Jquery function for check element exist

jQuery.fn.exists = function(){return this.length>0;}


Example :

if($(".spl_req").exists()){   console.log("Element Exist");}else{
 console.log("Element Not Exist");
} 

No comments:

Post a Comment