URL Fragment Text Directives
TheURL fragment text directives API allows web apps to interact withtext fragments in the URL.Text fragments allow linking directly to a specific portion of text in a web document, without requiring the author to annotate it with an ID, using a particular syntax in the URL fragment.
In this article
Interfaces
FragmentDirectiveA (currently) empty object.The existence of an object of this type in
document.fragmentDirectiveis used for feature detection.
Extensions to other interfaces
Document.fragmentDirectiveA property that returns a
FragmentDirectiveobject for the current document. Currently only used for feature detection.
CSS selectors
::target-textRepresents the text that has been scrolled to. It allows authors to choose how to highlight that section of text.
Specifications
| Specification |
|---|
| URL Fragment Text Directives> # dom-document-fragmentdirective> |
| URL Fragment Text Directives> # fragmentdirective> |
| CSS Pseudo-Elements Module Level 4> # selectordef-target-text> |