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 |
Explain the use of the .pushstack() method.
Explain the use jquery.data method?
Where jquery mobile works? : jquery mobile
Can you include multiple version of jQuery? If yes, then how they are executed?
With jquery which operating system is more compatible?
How to read cookies in jquery?
Consider a scenario where things can be done easily with javascript, would you still prefer jQuery?
Can you call C# code-behind method using jQuery? If yes,then how?
Which is the starting point of code execution in jQuery?
Can we use jQuery to make ajax request?
What are selectors in jquery? Explain
What does dollar sign ($) means in jquery? : jquery mobile