www.fgks.org   »   [go: up one dir, main page]

Click to Rate and Give Feedback
Properties
 specified Property
specified Property

Gets whether an attribute has been specified.

Syntax

[ bSpecified = ] attribute.specified

Possible Values

bSpecifiedBoolean that receives one of the following values.
trueAttribute is specified.
falseAttribute is not specified.

The property is read-only. The property has 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 "LI");
      var  + " "
                     + 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 >
<LI>Click to Find Specified Attributes
</UL>

Standards Information

This property is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 World Wide Web link.

Applies To

attribute

See Also

About the W3C Document Object Model
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG