WebLinuxStudy

导航

 

2020年10月15日

摘要: 只需要判断指定ID对象的length是否大于0 jQuery方法: if ($("#ID").length > 0) { alert('对象存在');}else alert('对象不存在');} Javascript原生: if (document.getElementById("ID")) { a 阅读全文
posted @ 2020-10-15 16:42 WebLinuxStudy 阅读(1500) 评论(0) 推荐(0)