Atribut HTML DOM
Objek Attr
Dalam DOM HTML, objek Attr mewakili atribut HTML.
Atribut HTML selalu menjadi milik elemen HTML.
Objek NamedNodeMap
Dalam HTML DOM, objek NamedNodeMap mewakili kumpulan node atribut elemen yang tidak berurutan.
Node dalam NamedNodeMap dapat diakses berdasarkan nama atau indeks (angka).
Properti dan Metode Atribut
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 |
Properti dan Metode 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 |