jQuery 判断元素-是否存在
ITPOW2017/2/27 11:14:29
if ($("#good").length <= 0) { alert("不存在。"); } else { alert("存在。"); }
如上,用 length 属性判断数组长度,以决定元素是否存在。
<<返回首页<<