HTML DOM Attributes removeNamedItem() method
- Previous page name
- Next page setNamedItem()
- Go back to the previous level HTML DOM Attributes
definition and usage
removeNamedItem()
The method deletes the node with the specified name in the namedNodeMap.
example
remove from input button type attribute:
const nodeMap = document.getElementById("myInput").attributes; nodeMap.removeNamedItem("type");
tip:After deleting the type attribute of the input element, the element will become a text type, that is, the default value.
syntax
namednodemap.removeNamedItem(nodename)
parameter
parameter | description |
---|---|
nodename | required. The name of the attribute node to be deleted. |
return value
type | description |
---|---|
node | the deleted attribute node. |
browser support
attributes.removeNamedItem()
is a feature of DOM Level 1 (1998).
All browsers support it:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | 9-11 | Support | Support | Support | Support |
- Previous page name
- Next page setNamedItem()
- Go back to the previous level HTML DOM Attributes