JSFiddle - React, Tailwind, and code Playground

HTML

<div id="elt1" class="elt" val="text1">
    text1
    <div id="elt2" class="elt" val="text2">
        text2
    <div>
</div>

CSS

#elt1 {
    background-color: blue;
}

#elt2 {
    background-color: cyan;
}

JavaScript

$(document).ready(function() {
    $(".elt").mouseenter(function() {
        console.log($(this).attr('val'));
    });
})