deleteFromDocument

The deleteFromDocument() method of the Selection interface invokes the Range.deleteContents() method on the selected Range.

MDN Reference