JSFiddle - React, Tailwind, and code Playground

by Nicolas PUJOL

HTML

<input type="text" value="Hello World">

JavaScript

$("input").select(function() {
    var elem = document.activeElement
    console.log(elem.value.substring(elem.selectionStart, elem.selectionEnd));
});