HTML DOM Element remove() method
- Previous Page querySelectorAll()
- Next Page removeAttribute()
- Go to Parent HTML DOM Elements Object
Definition and Usage
remove()
The method removes an element (or node) from the document.
Note:An element or node is removed from the Document Object Model (DOM).
See also:
Example
Remove an element from the document:
const element = document.getElementById("demo"); element.remove();
Syntax
element.remove()
or
node.remove()
Parameter
None.
Return Value
None.
Browser Support
element.remove()
It is a DOM Living Standard feature.
All modern browsers support it:
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Supported | Supported | Supported | Supported | Supported |
element.remove() is not supported in Internet Explorer 11 (or earlier versions).
- Previous Page querySelectorAll()
- Next Page removeAttribute()
- Go to Parent HTML DOM Elements Object