JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test">
<p>Some text</p>
<img src="http://davidrhysthomas.co.uk/img/dexter.png" />
</div>
CSS
#test {
background-color: rgba(0, 0, 0, 0);
}
JavaScript
$('#test').animate({ background-color: rgba(0, 0, 0, 0.7) },1000);