Javascript Reference
Categories: Element

javascript Element mergeAttributes( )

@March 15, 2008, 1:22 a.m.
mergeAttributes( )Firefox/Netscape/NN n/a IE 5(Win) Chrome/Safari/DOM n/a  

mergeAttributes(modelElementReference[, preserveIDs])

  

Copies attribute name/value pairs from the element specified as a parameter to the current element. This is helpful for copying a large set of attributes from an existing element to a newly created element. By default, the copy does not include the id or name attributes so that the two elements maintain separate identifiers for scripting and form purposes. Starting with IE 5.5/Windows, an optional Boolean second parameter, when set to false, duplicates id and name attributes as well.

 
Parameters
 
  • Reference to an existing element that serves as a model for attribute name/value pairs to be copied to the current element.
  • An optional Boolean value. If false, the id and name attributes from the model element are not copied to the current element. The default for this parameter is true.
 
Returned Value

None.


Powered by Linode.