JSFiddle - React, Tailwind, and code Playground
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();