W3cubDocs

/Web APIs

Document: fragmentDirective property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The fragmentDirective read-only property of the Document interface returns the FragmentDirective for the current document.

Value

Examples

Try running the following in a supporting browser's devtools, in a tab with one or more matched text fragments:

js

document.fragmentDirective;
// returns an empty FragmentDirective object, if supported
// undefined otherwise

This functionality is mainly intended for feature detection at present. In the future, the FragmentDirective object could include additional information.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
fragmentDirective 86 86 No No 72 No 86 86 No 61 No 14.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Document/fragmentDirective