JSFiddle - React, Tailwind, and code Playground

by Tushar Gupta

HTML

When you click in the input, I would like to select all the numbers.
<br />But if you click between 2 numbers, the selected is canceled by the typing cursor.
<br />Anyway to avoid that?
<br />
<input type="text" id="t1" class="class-focusin" value="4578" />
<br />
<br />Regular input
<br />
<input type="text" class="class-not-focusin" value="457887" /

JavaScript

$(document).ready(function () {
    $('.class-focusin').click(function (e) {

        $(this).select();

    });
});