asp.net.ph

Skip Navigation Links

specified Property

Language References


Retrieves whether an attribute has been specified.

Syntax

HTML N/A
Script [ bSpecified = ] object.specified

Possible Values

true The attribute is specified.
false The attribute is not specified.

The property is read-only with no default value.

Remarks

An attribute set via HTML or script is considered to be specified.

Example

The following sample demonstrates the use of the specified property to determine if an attribute is specified by the author. The results are produced using the createElement method to create a new LI object, the createTextNode method to create a new text node, and the appendChild method to add the new elements to the list.

<script language="JavaScript">
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>
  <li>Click to Find Specified Attributes
</ul>
Applies To

Attribute


Need a break ?
Suggested Reading

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph.

If you have any question, comment or suggestion,
please send us a note