JSFiddle - React, Tailwind, and code Playground
by abhitalks
HTML
<input id="txt" type="text" value="input" /><br />
<label for="chk" accesskey="L">Checkbox: </label>
<input id="chk" type="checkbox" /><br />
<input id="btn" type="button" value="Focus Label" />
CSS
* { margin: 8px; }
.highlight { background-color: yellow; }
:focus {
outline: 2px solid blue;
}
JavaScript
label = $("label").first();
$("#btn").on("click", function() {
label.focus();
});