Inside JavaScript

The setAttributeNode Method

The setAttributeNode method assigns an attribute node to a node. You can see the support for this method in Table 6.49.

Table 6.49. The setAttributeNode Method

Method

NS2

NS3

NS4

NS6

IE3a

IE3b

IE4

IE5

IE5.5

IE6

setAttributeNode( attributeNode )

     

x

         

x

 

Returns: Attribute object

The setAttributeNode is the W3C analog to the setAttribute method discussed in the preceding section. To assign an attribute node to another node capable of supporting attributes, you just pass that attribute node to this method:

elementNode.setAttributeNode(attributeNode)

Категории