extractContents

The extractContents() method of the Range interface is similar to a combination of Range.cloneContents() and Range.deleteContents().

MDN Reference