Studyon Minte9.com
jQuery




Element exists



if ($("#mydiv").length > 0){
  // do something here
}


http://aaronrussell.co.uk/legacy/check-if-an-element-exists-using-jquery/