JSFiddle - React, Tailwind, and code Playground

by michaelburtonray

HTML

<span class="parent" contenteditable>Click me</span>

CSS

.parent {
    background: oldLace;
    cursor: pointer;
}

.parent:focus {
    cursor: initial;
}

JavaScript

$('.parent > *')
    .focus(function() {
        $('.parent').addClass('focused');
    })
    .blur(function() {
        $('.parent').removeClass('focused');
    });