Visit Mozilla.org

DOM:range.setEndBefore

From MDC

« Gecko DOM Reference

Contents

[edit] Summary

Sets the end position of a Range relative to another Node.

[edit] Syntax

range.setEndBefore(referenceNode);

[edit] Parameters

referenceNode 
The Node to end the Range before

[edit] Example

range = document.createRange();
referenceNode = document.getElementsByTagName("div").item(0);
range.setEndBefore(referenceNode);

[edit] Notes

The parent Node of end of the Range will be the same as that for the referenceNode.

[edit] Specification

setEndBefore