JSFiddle - React, Tailwind, and code Playground

HTML

<input id="selectMe" value="123" /><input type="button" id="focusHim" value="Im working fine" />

JavaScript

$('#selectMe').focus( function() {
    $(this).select();
    console.log('focus fired');
});

$('#focusHim').click( function() {
    $('#selectMe').focus();
});