javascript Range comparePoint( )
@March 15, 2008, 1:22 a.m.
comparePoint( ) | Firefox/Netscape/NN 6 IE n/a Chrome/Safari/DOM n/a | |||||||
compareNode(nodeReference, offset) | ||||||||
A Netscape-only method that returns an integer code indicating the relative position of some other node and offset within that node with respect to the current range. Note that the returned values are from the point of view of the node (more specifically, the point signified by the offset within the node) passed as parameters, rather than from that of the current range. |
||||||||
Returned values are as follows. |
||||||||
|
||||||||
By way of example: if (rng.comparePoint(document.getElementById("myElem"), 2) == 0) { // process for offset of 2 within myElem node being contained by the range } |
||||||||
Parameters | ||||||||
|
||||||||
Returned Value | ||||||||
Integer values -1, 0, 1. |
Permanent URL:
http://javascript.gakaa.com/range-comparepoint-4-0-5-.aspx
Powered by Linode.