通过length属性判断jquery对象是否存在_jquery
来源:动视网
责编:小采
时间:2020-11-27 21:14:31
通过length属性判断jquery对象是否存在_jquery
通过length属性判断jquery对象是否存在_jquery: 代码如下: //jquery 通过得到对象的长度判断对象是否存在 function testJquery() { if ($(.tel).length > 0) { alert(存在); } else { alert(不存在); } }
导读通过length属性判断jquery对象是否存在_jquery: 代码如下: //jquery 通过得到对象的长度判断对象是否存在 function testJquery() { if ($(.tel).length > 0) { alert(存在); } else { alert(不存在); } }

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