JSFiddle - React, Tailwind, and code Playground
HTML
<div class="comment">
<div class="commentact">
Test1
</div>
</div>
<div class="comment">
<div class="commentact">
Test2
</div>
</div>
<div class="comment">
<div class="commentact">
Test3
</div>
</div>
JavaScript
$(function(){ // DOM ready
$(".commentact").fadeTo(0, 0.2); // initial opacity
$(".comment").hover(function( e ) {
$(".commentact", this).stop().fadeTo(300, e.type=="mouseenter"?1:0.2);
});
});