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

How to submit a form without submit button using jquery?

806


How can we apply css in div using jquery?

906


What happen if you return false from a jQuery event handler?

839


How do you select an item using css class or id and get the value by use of jquery.

788


Explain .live()? : jquery mobile

806


How to find grand children in of an element?

798


What is the use of jQuery filter?

776


How to validate email using jquery?

882


Can you please explain the difference between event.preventdefault and "return false"? : jquery mobile

795


Do you know what is the use of jquery.data()?

789


How can you get the type of arguments passed to a function?

821


Explain the each() function?

835


Is jquery library used for server scripting or client scripting?

773


What is jquery.noconflict? Explain

806


Explain the use of data-role=”page” attribute? : jQuery Mobile

806