通过length属性判断jquery对象是否存在


复制代码 代码如下:

//jquery 通过得到对象的长度判断对象是否存在
function testJquery() {
if ($(".tel").length > 0) {
alert("存在");
}
else {
alert("不存在");
}
}

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3