如
<label for="lbl1">1</label>
<label for="">2</label>
<label>3</label>
----------------------------
用Jquery找出第三个要怎么找,
要一次定位到谢谢
<label for="lbl1">1</label>
<label for="">2</label>
<label>3</label>
----------------------------
用Jquery找出第三个要怎么找,
要一次定位到谢谢
-----------
这个,
也就是没有注意for属性的label
谢谢
if(this.getAttribute("for")===null)//If the attribute is not present, this method returns null.
return true;
}).html();
alert(res)
---------
javascript === 是什么意思?
if(this.hasAttribute && !this.hasAttribute("for") || this.getAttribute("for")===null)
//MSDN:If the attribute is not present, this method returns null.
//MDC:If the named attribute does not exist, the value returned will either be null or "" (the empty string);
//如果不考虑IE6可以直接使用hasAttribute判断
return true;
}).html();
alert(res)
alert(undefined===null)//===判断引用
alert($('label').not($('label[for]')).html())
});
if((this.hasAttribute && !this.hasAttribute("for")) || (!this.getAttributeNode("for").specified))
return true;
}).html();
alert(res)