Web Development jQuery Subjective
Aug 07, 2013

How to use length function in jQuery to text existance of an element by Id ?

Detailed Explanation

To test if an element exists we can use length method in jQuery as below:
if $(''#mySampleDiv'').length )//Tests wheter the div with id mySampleDiv exists or not
$(mySampleDiv).find(''div'');

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback