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 check or uncheck all checkboxes using jquery?

787


Tell me how do you stop the currently-running animation? : jquery mobile

687


How to use jquery.connect?

762


How to get/set the html contents of an element using jQuery?

794


List browser related issues for jquery?

723


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

768


What is .detach()? : jquery mobile

817


How do you disable or enable a form element?

741


What is the use of jquery.data()?

790


How to run an event handler only once in jQuery?

835


Define jquery filter?

790


What is the difference between onclick and onsubmit?

792


Explain is jquery replacement of java script? : jquery mobile

744


Will Events Are Also Copied On Clone In Jquery?

734


How to debug jquery code/ debug jquery?

823