document.getElementById("ax") 返回 null
document.getElementsByName("mm"); 不返回null 返回 object
因此判斷是否存在
document.getElementById("ax") == null
document.getElementsByName("mm").length <= 0
最后
以上就是细心小伙最近收集整理的关于JS 判斷控件是否存在的全部内容,更多相关JS内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复