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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Which are the fastest selectors in jquery? : jquery mobile

814


How can we include jQuery library in ASP.Net project?

946


Explain various methods to make ajax request in jquery?

825


Explain .empty() vs .remove() vs .detach().

935


What are the features of jquery used in web applications?

888


What does $("P") will select?

914


What are two different version of jquery library? : jquery mobile

835


List the basic selectors in jquery?

850


What does dollar sign ($) me in jquery?

986


Explain the difference between onload() and document.ready() function used in jquery?

839


Explain each() function in jquery?

5400


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

918


What are the different ways of using $.connect function in jquery?

872


Difference between javascript and jquery? : jQuery Mobile

886


How to call a method inside code-behind using jquery?

842