Using Range to Select and Delete Content
The W3C DOM Range API consists of a single interface, Range. This interface exposes the ability to select contiguous portions of a structured document, delineated by specified beginning and end points. The Range interface contains methods that allow copying, inserting, or deleting of content, as well as methods for marking the start and end points of the content range.