const spellErrorRange = new Range();
spellErrorRange.setStart(textNode, 10);
spellErrorRange.setEnd(textNode, 20);
const spellErrorsHighlight = new Highlight(spellErrorRange);
spellErrorsHighlight.type = "spelling-error";Highlight: type property / notebook
Highlight: type property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.