This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.


Method of dom/Elementdom/Element


var object = object.createControlRange();

Return Value

Returns an object of type DOM NodeDOM Node


Returns a controlRange collection if sucessful or a null value otherwise.


This example creates a controlRange by using the createControlRange method.

oControlRange = document.body.createControlRange();



Creates a selection range object for control-based selection rather than text-based selection. If a controlRange already exists, createControlRange overwrites the existing element; otherwise, it returns a pointer to the element created. If there are currently controls selected in the text container, the control range is initialized with them; otherwise, it is created empty and controls need to be explicitly added to it. This is opposite of the text range, which defaults to the whole text container if there is no selection.


Standards information

There are no standards that apply here.

See also

Related pages