JSFiddle - React, Tailwind, and code Playground
HTML
<h2 contenteditable="true" id="before">Click here and Press Tab.</h2><br/><br/>
<div contenteditable="true">
<p id="test">Test</p>
</div>
JavaScript
$( "#test" ).focus(function() {
$( "<span>Focused!</span>" ).appendTo( "body" ).fadeOut( 1000 );
});
$("#before").on('keydown', function(e){
if(e.which == 9){
$('#test').triggerHandler('focus');
}
});
$("#test").bind( "focus", function() {
$("#test").css('background', 'yellow');
});