Friday, September 7, 2012

Is there an “exists” function for jQuery, Check Element Exits or not With jQuery

Is there an “exists” function for jQuery







Solution : 



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

if (  $(selector).exists()  ) {
         // Do something
}


There you go!





Cheers !
Hope you got the Ans !
still having probs ? let me know by comments !

Know More About :
PHP Freelancing India

Reactions:

1 comment:

  1. Great articles and useful information for readers. Thanks for sharing such good articles. hire php developer
    hire php programmers

    ReplyDelete

Any Questions or Suggestions ?

About

Professional & Experienced Freelance Developer From India, Technologist, Software Engineer, internet marketer and Open Sources Developer with experience in Finance, Telecoms and the Media. Contact Me for freelancing projects.

Enter your email address:

Delivered by FeedBurner

PHP Freelancer India - Google+