if ($(" #elementid").length) { //元素存在 }