This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

specified

Property of dom/HTMLElementdom/HTMLElement

Syntax

var 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.

Syntax

Standards information

Attributions