Table of contents
- 1. Summary
- 2. Syntax
- 3. Parameters
- 4. Examples
Summary
Deletes the actual text being represented by a selection object from the document's DOM.
Syntax
sel.deleteFromDocument()
Parameters
None.
Examples
A user selects the (imaginary) text "ve two ea" from "Rabbits have two ears." on a web page. The user then clicks a button that executes the JavaScript snippet window.getSelection().deleteFromDocument(). The document's text becomes "Rabbits hars."


Mozilla Developer Network