Click to return to the DHTML, HTML     
SPAN Attribute | span Pro...     SRC Attribute | src Prope...     DHTML Properties    
Web Workshop  |  DHTML, HTML & CSS

specified Property


Retrieves whether an attribute has been specified.

Syntax

HTMLN/A
Scripting[ bSpecified = ] object.specified

Possible Values

bSpecified Boolean that specifies one of the following values:
trueAttribute is specified.
falseAttribute is not specified.

The property is read-only with no default value.

Remarks

An attribute is specified if it is set through HTML or script.

Example

This example uses the specified property to determine the attributes set for an object. The function checks each attribute, and lists all of the attributes of the object and the value of each attribute. In addition, each attribute that is set is displayed.

<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
</UL>

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Attribute


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.