jquery 检测元素是否存在的实例代码

内容摘要
if ($('#myDiv).length) { // your code }
Simple, but not obvious.
文章正文

if ($('#myDiv).length) { 
    // your code 
}

 Simple, but not obvious.


代码注释

作者:喵哥笔记

IDC笔记

学的不仅是技术,更是梦想!