Web features explorer

OpaqueRange

Limited availability

The createValueRange() for form elements, such as <textarea> or <input type="text">, gets an OpaqueRange object that represents a live span of text. You can use this for range-based operations on the input text, such as setting custom highlights or placing autocomplete popovers.

Browser support

  • Chrome Not supported Bugs: 421421332
  • Chrome Android Not supported
  • Edge Not supported
  • Firefox Not supported Bugs: 2038248
  • Firefox for Android Not supported
  • Safari Not supported
  • Safari on iOS Not supported

Need this feature?
Leave a 👍 on the feedback issue
Don't forget to also leave a comment explaining your specific use case.

MDN documentation

No MDN documentation found. You can search for the feature on MDN. If you believe that MDN has no documentation about this feature, you can open an issue on MDN's GitHub repository.

Developer use cases

  • I have a personal tasks and notes management web application I work on, where notes are added and edited in `<textarea>` elements whose contents are rendered using Markdown syntax. This includes some wikimedia-inspired customisation such as creating links to other pages using `[[identifier]]` syntax. I'd like to be able to place an autocomplete hint dropdown, or similar UI, at the caret position when one of these custom links is being written. I have a personal tasks and notes management web application I work on, where notes are added and edited in `<textarea>` elements whose contents are rendered using Markdown syntax. This includes some wikimedia-inspired customisation such as creating links to other pages using `[[identifier]]` syntax. I'd like to be able to place an autocomplete hint dropdown, or similar UI, at the caret position when one of these custom links is being written. [see original comment]