javascript attributes setNamedItem( )

setNamedItem( ) NN 6 IE 6 DOM 1  

setNamedItem(attrObjectReference)

  

Inserts a single Attr object into the current collection of attributes. If the destination of the attribute is an existing element, you may also use the setAttributeNode( ) method on the element to insert the Attr object. When the setNamedItem( ) method is invoked, the browser first looks for a match between the new attribute's name and existing attribute names within the collection. If there is a match, the new attribute replaces the original one; otherwise, the new attribute is added to the collection.

 
Parameters
 
attrObjectReference

A reference to an Attr node object created through document.createAttribute( ) or an Attr node from another element in the document tree.

 
Returned Value

Reference to an Attr object either created anew or referenced from elsewhere in the document tree.


295,Nickname,Homepage or email,Comments here,Add comment