JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box second">
<div>
<img class="img2" src="/img/logo.png" />
</div>
<a href="a2.html"><h3 class="h2"> Day of the Dead </h3></a>
<p></p>
</div>
<div class="box third">
<div>
<img class="img3" src="/img/logo.png" />
</div>
<a href="a3.html"><h3 class="h3"> Evil dead </h3></a>
<p></p>
</div>
JavaScript
$('.box').on('mouseenter mouseout', 'img, h3', function (e) {
var shadow = e.type == 'mouseenter' ? 'inset 0 0 20px black' : '';
$(this).closest('.box').find('img').css('box-shadow', shadow);
});