if ( $("#mydiv").length ){
// do something here
}
Briefer again…
if ( $("#mydiv")[0] ){
// do something here
}
via http://aaronrussell.co.uk/legacy/check-if-an-element-exists-using-jquery/
if ( $("#mydiv").length ){
// do something here
}
Briefer again…
if ( $("#mydiv")[0] ){
// do something here
}
via http://aaronrussell.co.uk/legacy/check-if-an-element-exists-using-jquery/