jquery 检测元素是否存在

if ($('#myDiv).length) {  

    // your code  

}

posted @ 2009-03-21 20:26  hsxiaoma  阅读(140)  评论(0编辑  收藏  举报