我只是碰到这样的事情跌跌撞撞......DOM元素的属性指定了什么属性?
function(element) {
...
var attributes = element.attributes;
for (var index = 0, length = attributes.length; index < length; index++) {
var attribute = attributes[index];
// what is ".specified"?
if (attribute.specified) {
...
}
}
}
我在寻找一个DOM元素,元素接口的W3C规范,和我没有看到任何地方specified
。
http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-745549614
是什么attribute.specified
意思?它代表什么?规格在哪里定义?
你在想这个吗? http://www.w3schools.com/jsref/prop_attr_specified.asp – LNendza
是的,这就是我正在谈论的 – Hristo
我不知道它在规格中的定义,但我发现它们的定义非常合适: 如果指定了属性,则指定的属性返回true。 如果属性已创建但尚未附加到元素,则返回true。 否则它返回false。 我相信它正在被贬损的方式。 – LNendza