/

HTML / CSS / JavaScript Tutorial

JavaScript DOM HTML method: setAttributeNode ()

[this page | pdf | back links]

The setAttributeNode() method (when applied to HTML elements in the JavaScript DOM) sets specified attribute node (i.e. adds it to the element if it didn’t previously exist, or replaces the old one, if the element already had the attribute).

 

It has the following syntax with the following parameters. It does not return a value.

 

element.setAttributeNode(attributenode)

 

Parameter

Required / Optional

Description

attributenode

Required

An Attr object representing the attribute node to be set

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile