JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" value="test" />

JavaScript

$('input[type=text]').on('focus', function() {
   $(this).select();
});