Atributos HTML DOM
El objeto Attr
En el DOM HTML, el objeto Attr representa un atributo HTML.
Un atributo HTML siempre pertenece a un elemento HTML.
El objeto NamedNodeMap
En el DOM de HTML, el objeto NamedNodeMap representa una colección desordenada de nodos de atributos de elementos.
Se puede acceder a los nodos en un NamedNodeMap por nombre o por índice (número).
Propiedades y métodos de atributos
Property | Description |
---|---|
isId | Deprecated |
name | Returns an attribute's name |
value | Sets or returns an attribute's value |
specified | Returns true if the attribute is specified |
Propiedades y métodos de NamedNodeMap
Method | Description |
---|---|
getNamedItem() | Returns an attribute node (by name) from a NamedNodeMap |
item() | Returns an attribute node (by index) from a NamedNodeMap |
length | Returns the number of attributes in a NamedNodeMap |
removeNamedItem() | Removes an attribute (node) |
setNamedItem() | Sets an attribute (node) by name |