JSFiddle - React, Tailwind, and code Playground
by David Thomas
HTML
<div id="test" tabindex="-1">
<textarea>Something</textarea>
</div>
CSS
div {
border: 2px dashed #f90;
width: 50%;
margin: 0 auto;
}
textarea {
display: block;
width: 80%;
margin: 1em auto;
}
JavaScript
$('textarea').focus(
function(){
$(this).parent('div').css('border-style','solid');
}).blur(
function(){
$(this).parent('div').css('border-style','dashed');
});