JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" value="hello"/>
JavaScript
$("input[type=text]").click(function() {
$(this).select();
});
<input type="text" value="hello"/>
$("input[type=text]").click(function() {
$(this).select();
});