JSFiddle - React, Tailwind, and code Playground

by Michel Plungjan

HTML

<input type="text" value="click me to autoselect" />
<input type="url" value="click me to autoselect" />

JavaScript

$("input[type=text], input[type=url]").click(function() {
 // the select() function on the DOM element will do what you want
 $(this).select();
});