Check the jQuery FAQ…
You can use the length property of the jQuery collection returned by your selector:
if ( $('#myDiv').length ){}
Check the jQuery FAQ…
You can use the length property of the jQuery collection returned by your selector:
if ( $('#myDiv').length ){}