The deleteFromDocument() method deletes the selected text from the document’s DOM tree.
- No parameters
The example delete the selected text by clicking a button. Upon clicking the button, the Window.getSelection() method gets the selected text, and with the help of deleteFromDocument() method removes it.
Select some text and then click on button to delete it from document.
- Google Chrome