JSFiddle - React, Tailwind, and code Playground
HTML
<svg width="100" height="100">
<rect x="20" y="20" width="60" height="60" fill="black" class="myRect"></rect>
</svg>
JavaScript
$("svg").on('mouseenter', '.myRect', function() {
console.log('Hovered By Class');
});
$("svg").on('mouseenter', 'rect', function() {
console.log('Hovered By Element');
});