JSFiddle - React, Tailwind, and code Playground
HTML
<div id="container">
<label for="name">Name:</label>
<input type="text" id="name">
</div>
<button id="submit">Focus</button>
CSS
label {
font: 15px 'Exo 2', sans-serif;
}
input {
margin: 6px;
}
button {
margin-top: 10px;
padding: 2px 5px;
font: 15px 'Exo 2', sans-serif;
}
JavaScript
$(document).ready(function() {
$('#submit').click(function() {
$("#name").focus();
})
});