How do you check if an element exists or not in jQuery?
Answer / chaitanya
Using jQuery length property, we can ensure whether element exists or not.
Hide Copy Code
$(document).ready(function(){
if ($('#element').length > 0){
//Element exists
}
});
Is This Answer Correct ? | 0 Yes | 0 No |
What is a filter in jquery? Explain
Mention some advantages of jquery.
What are the features of jQuery, has been used in web applications?
What is the use of each function in jQuery?
Explain url paremeter of jquery ajax method?
What is the difference between onload() and document.ready() function used in jquery?
Explain the features of jquery mobile? : jquery mobile
Can you use any other name in place of $ (dollar sign) in jQuery?
What does dollar sign ($) means in jquery? : jquery mobile
Is jQuery a W3C standard?
What is $('div')? : jquery mobile
Which command will give a version of jQuery?