if ($("#someDiv").length) { //hooray!!! it exists... }