Saturday, 24 August 2013

Previous Interview Question Next Interview Question
Home

How do you check if an element exists or not in jQuery?

Using jQuery length property, we can ensure whether element exists or not.
$(document).ready(function(){
    if ($('#element').length > 0){
       //Element exists
  });
});

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment