JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test" style="background: green;">test</div>

JavaScript

$('#test').click(function(){
    alert($(this).css('background-color'));
});