JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" value="default" /> <button type="button">Select</button>

JavaScript

$('input:text').change(function () {
    alert('changed');
});

$('button').click(function () {
    $('input:text')[0].select();
});