JSFiddle - React, Tailwind, and code Playground

HTML

<img src='myImage.jpg' width='100' height='20' id='myImage'>

CSS

.titleText
{
     background-color: #CCC;
      color: #FFF;
   border: solid 1px #666; 
    width: 100px;
}

JavaScript

$('#myImage').hover(function(){
   var id = $(this).attr('id');
   var tid = 'text_' + id;
   var d = $('<div>');
   $(d).addClass('titleText')
       .attr('id', tid)
       .html('my Image Text').appendTo('body'); 
    
   var pos = $(this).position();
   var h = $(this).height();
    $(d).css({
        left: pos.left,
        top: post.top + h 
    });
}, function(){
    var id = $(this).attr('id');
   var tid = 'text_' + id;
    $('#'  + tid).remove();
});