JSFiddle - React, Tailwind, and code Playground

HTML

<div id='container'>
    <div id='one'>one</div>
    <div id='two'>two</div>
    <div id='three'>three</div>
</div>

CSS

#container div {
    width: 50px;
    height: 50px;
    border: 2px dashed red;
    margin: 10px;
    color: white;
    background:orange;
}

JavaScript

$('#container div').click(function() {
    $th = $(this);
    $th.css('backgroundColor','yellow');
    var value = $th.text()
    alert(value);
});