js中如何判断一个DOM对象是否存在?

<div id="div1"></div>

 
if(!!document.getElementById("div1"))

posted on 2016-05-25 20:06  玉衡逸柔  阅读(1883)  评论(0编辑  收藏  举报

导航