startContainer property (Range)
Returns a reference to the deepest node in the DOM hierarchy that contains the start point of the current Range object.
Note: The Range object and its startContainer property are supported in Internet Explorer from version 9.Use it together with the startOffset property to get the exact start point of the current Range object.
- If you want to modify the start or end point, use the setStart / setStartBefore / setStartAfter and the setEnd / setEndBefore / setEndAfter methods.
- If you want to align the boundary points of a Range to the start and end points of an element or its contents, use the selectNode or selectNodeContents method.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Reference to the deepest node that contains the start point of the Range object.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the startContainer property:
Did you find this example helpful?
User Contributed Comments