blob: a765682abb7d34633dd39839cc41b1f381508cb5 [file] [log] [blame]
<meta name="viewport" content="width=device-width, initial-scale=1">
<code><p id="paragraph" style="font-size: 200px;">START DRAGGING</p></code>
<script>
function select(node) {
let range = document.createRange(node);
range.setStartBefore(node);
range.setEndAfter(node);
getSelection().removeAllRanges();
getSelection().addRange(range);
}
select(paragraph.childNodes[0]);
document.body.addEventListener("dragstart", () => {
getSelection().removeAllRanges();
paragraph.textContent = "PASS";
paragraph.style.color = "green";
});
</script>