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 the starting point of code execution in jquery? : jquery mobile

0 Answers  


Explain slidetoggle() effect.

0 Answers  


What is the advantage of using protocol less URL while referencing jQuery from CDNs?

1 Answers  


What is jQuery CDN?

0 Answers  


What is meant by a deep copy? : jQuery Mobile

0 Answers  


What is the difference between $('div') and $('<div/>') in jQuery?

1 Answers  


How we can check if an element is empty or not using jquery?

0 Answers  


How you get server response from an ajax request using jquery?

0 Answers  


How To Use Ajax In Jquery?

0 Answers  


How can jquery library be added to pages? Write a basic jquery code?

0 Answers  


What is difference between $(this) and ‘this’ in jquery?

0 Answers  


What is the use of val() method in jquery?

0 Answers  


Categories