Javascript Reference
Categories: event

javascript event rangeOffset

@March 15, 2008, 1:22 a.m.
rangeOffsetFirefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM n/a

Read-only

Returns an integer of the character offset within a node that the Netscape 6 DOM considers a potential Range end point. The reference to the node is found in the associated rangeParent property of the event object. These two values can be passed as parameters to W3C DOM Range object methods for setting a start or end point. Thus, a mousedown event listener could establish the start point of a range, while a mouseup event listener function could set the end pointboth functions feeding rangeParent and rangeOffset values to the Range object methods.

 
Example
 
var rng;
function processMouseDown(evt) {
    rng = document.createRange( );
    rng.setStart(evt.rangeParent, evt.rangeOffset);
}
 
Value

Integer.

 
Default

0


Powered by Linode.