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