Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How do you check if an element exists or not in jQuery?



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

Post New Answer

More jQuery Interview Questions

Explain how jquery works?

0 Answers  


Explain cdn in jquery?

0 Answers  


Is Uncaught TypeError: $(…).modal not a function jquery?

0 Answers  


Define the types of selectors in jquery?

0 Answers  


Why we use jquery .each() function?

0 Answers  


How to add and remove css classes to an element using ?

0 Answers  


Define animate function in jquery?

0 Answers  


How can events be prevented to work after an ajax request?

0 Answers  


How to find all sibling elements after the current element using ?

0 Answers  


What is the difference between find and children methods in jquery?

0 Answers  


Why is not dom ready working for jquery mobile? : jquery mobile

0 Answers  


Can you use multiple document.ready() function on the same page?

0 Answers  


Categories