JSFiddle - React, Tailwind, and code Playground

by James Allardice

HTML

<input id="test" value="Some long text that is too long for the input">

JavaScript

var elem = document.getElementById("test");

elem.addEventListener("select", function () { console.log("SELECT"); }, false);
    
elem.setSelectionRange(24, 25);
elem.focus();