Property of dom/HTMLElementdom/HTMLElement
Syntaxvar result = element.specified;
element.specified = value;
Examples
The following code example uses the specified property to determine the attributes that are set for an object. The function checks each attribute and lists all of the attributes of the object and their values.
<script>
function fnFindSpecified(){
var oAttributes=oList.attributes;
alert(oAttributes(0).nodeName);
for(var i=0;i<oAttributes.length;i++){
var oNode=document.createElement("LI");
var oNodeValue=document.createTextNode(i + " "
+ oAttributes(i).nodeName + " = "
+ oAttributes(i).nodeValue);
oList.appendChild(oNode);
oNode.appendChild(oNodeValue);
if(oAttributes(i).nodeValue!=null){
alert(oAttributes(i).nodeName
+ " specified: " + oAttributes(i).specified);
}
}
}
</script>
<ul id="oList" onclick= "fnFindSpecified()">
<li>Click to Find Specified Attributes</li>
</ul>
Notes Remarks
An attribute value is specified if it is assigned through HTML or script. Windows Internet Explorer 9. When webpages are displayed in IE9 Standards mode, the attributes collection does not contain attributes that are not specifically created (unlike previous Windows Internet Explorer versions). As a result, the specified property returns true
for every item in the attributes collection.
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4