Javascript Reference
Categories: Attr

javascript Attr name

@May 11, 2009, 10:24 a.m.
name Firefox/Netscape/NN 6 IE 5 Chrome/Safari/DOM 1  

 

Read-only  

This is the name portion of the name/value pair of the attribute. It is identical to the nodeName property of the Attr node. You may not modify the name of an attribute by script because other dependencies may lead to document tree confusion. Instead, replace the old attribute with a newly created one, the name of which is a required parameter of the document.createAttribute() method.

 
Example
 
if (myAttr.name == "author") {
    // process author attribute
}
 
Value

String value.

 
Default

Empty string, although creating a new attribute requires a name.


Powered by Linode.