JSFiddle - React, Tailwind, and code Playground
HTML
<input id="foo" value="richard" type="text"/>
JavaScript
foo.select();
console.log(foo.value);
<input id="foo" value="richard" type="text"/>
foo.select();
console.log(foo.value);