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

Gamila ·
更新时间:2024-09-20
· 556 次阅读

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



length jQuery

需要 登录 后方可回复, 如果你还没有账号请 注册新账号