Attributi HTML DOM
L'oggetto Attr
Nel DOM HTML, l' oggetto Attr rappresenta un attributo HTML.
Un attributo HTML appartiene sempre a un elemento HTML.
L'oggetto NamedNodeMap
Nel DOM HTML, l' oggetto NamedNodeMap rappresenta una raccolta non ordinata di nodi di attributi di elementi.
È possibile accedere ai nodi in una NamedNodeMap per nome o per indice (numero).
Proprietà e metodi degli attributi
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 |
Proprietà e metodi 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 |