Range.comparePoint() - Web APIs | MDN
developer.mozilla.org · 312 words · saved by 1 readers
The Range.comparePoint() method returns -1, 0, or 1 depending on whether the referenceNode is before, the same as, or after the Range.
Syntax js comparePoint(referenceNode, offset) Parameters referenceNode The Node that the offset is relative to. offset An integer greater than or equal to zero describing the position inside referenceNode of the point to be checked. If referenceNode is a Node of type Text, Comment, or CDATASection, then offset is the number of characters from the start of referenceNode. For other Node types, offset is the number of child nodes from the start of the referenceNode. Return value A number. -1 if the point specified by the referenceNode and offset is before the start of this Range. 0…
saved by
related reading
- Selection: focusOffset property - Web APIs | MDNdeveloper.mozilla.org
- javascript - getClientRects() from window.getSelection() - Stack Overflowstackoverflow.com
- Intersection Observer API - Web APIs | MDNdeveloper.mozilla.org
- RandomA11y - Accessible Color Combinationsrandoma11y.com
- The Web Animation Performance Tier List | Motion Magazinemotion.dev
- GitHub - chenglou/pretext: Fast, accurate & comprehensive text measurement & layoutgithub.com
- The Web Animation Performance Tier List | Motion Magazinemotion.dev
- Pretext - Text measurement that never touches the DOM.pretextjs.dev
- GitHub - Experience-Monks/math-as-code: a cheat-sheet for mathematical notation in code formgithub.com
- JS cheat sheetprogramming-idioms.org
- Populating the page: how browsers work - Performance | MDNdeveloper.mozilla.org
- GitHub - bendc/frontend-guidelines: Some HTML, CSS and JS best practices.github.com