createRange method (document, XMLDocument)
Creates an empty Range object.
Note: The createRange method is supported in Internet Explorer from version 9.A Range object represents a contiguous part of the document. If you want to align a Range object to an element or to its contents, use the selectNode and selectNodeContents methods. For further details, see the page for the Range object.
You can find the related objects in the Supported by objects section below.
Returns the newly created Range object.
Example HTML code 1:
This cross-browser example shows how the contents of an element can be deleted with range objects:
Did you find this example helpful?
User Contributed Comments