TextFormat: TextFormat() constructor
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The TextFormat() constructor returns a new TextFormat object.
Syntax
new TextFormat()
new TextFormat(options)
Parameters
optionsOptional-
An optional object with the following properties:
rangeStart-
A number representing the start position of the text range that needs to be formatted.
rangeEnd-
A number representing the end position of the text range that needs to be formatted.
underlineStyle-
A string representing the underline style of the text range that needs to be formatted.
underlineThickness-
A string representing the underline thickness of the text range that needs to be formatted.
Specifications
| Specification |
|---|
| EditContext API # dom-textformat-constructor |
Browser compatibility
| desktop | mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
TextFormat() constructor
|
|
|
|
|
|
|
|
|
|
|
|
|
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.
See also
- The
TextFormatinterface it belongs to.