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

Whether we need to add jQuery file in both Master and Content page?

0 Answers  


What is the need for jquery? : jQuery Mobile

0 Answers  


How can you use array with jquery?

0 Answers  


What does the jQuery migrate function do?

0 Answers  


How can you delay document.ready until a variable is set?

0 Answers  


Difference between prop() and attr()? : jQuery Mobile

0 Answers  


What is the difference between $.map and $.grep in jQuery?

0 Answers  


Differentiate the concepts of .js and .min.js?

0 Answers  


Define the script build up by jquery?

0 Answers  


Jumping off of jquery ui for a second, do you 'release early, release often' with all of your projects? What are your thoughts on that strategy?

0 Answers  


What is wrong with this code line "$('#myid.3').text('blah blah!!!');"

1 Answers  


Can we call C# code behind using jQuery?

0 Answers  


Categories