JSFiddle - React, Tailwind, and code Playground
by slace
HTML
<input type="text" value="test" id="txt" /><input type="button" value="click" id="btn" />
JavaScript
var get = function(id) { return document.getElementById(id); }
get('btn').onclick = function(e) { e.preventDefault(); get('txt').focus(); get('txt').select(); }