blob: 884887b827e695a0840994ebb00717a4b12a193a [file] [log] [blame]
<!DOCTYPE html>
<head>
<style>
::highlight(example) {
background-color: yellow;
color:green;
}
</style>
</head>
<div id="target">
<span id="highlight">highlight</span>
</div>
<script>
let highlight = document.getElementById('highlight');
let highlightRangeGroup = new HighlightRangeGroup(new StaticRange({startContainer: highlight.childNodes[0], startOffset: 0, endContainer: highlight.childNodes[0], endOffset: 4}));
CSS.highlights.set("example", highlightRangeGroup);
</script>