Programmer's Guide > Interfaces > W3C Range interface > compareBoundaryPoints method
  
compareBoundaryPoints method
Compare the boundary-points of two Ranges in a document.
compareBoundaryPoints(how, sourceRange )
Parameters
CompareHowhow
A code representing the type of comparison, as defined above.
RangesourceRange
The Range on which this current Range is compared to.
Returns
short. -1, 0 or 1 depending on whether the corresponding boundary-point of the Range is respectively before, equal to, or after the corresponding boundary-point of sourceRange.
Throws
DOMException
WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the same Document or DocumentFragment.
INVALID_STATE_ERR: Raised if detach() has already been invoked on this object.