JSFiddle - React, Tailwind, and code Playground

HTML

<div class="touchMeNot"></div>

CSS

.touchMeNot{
    position:absolute;
    border: 1px solid red;
    height:50px;
    width:50px;
}

JavaScript

$('.touchMeNot').on('mouseenter',function(e){
    var maxX = $(window).width() - $(this).width();
    var maxY = $(window).height() - $(this).height();    
    $(this).css({
        'left':getRandomInt(0, maxX),
        'top':getRandomInt(0, maxY)
    });
});
function getRandomInt(min, max) {
    return Math.floor(Math.random() * (max - min + 1)) + min;
}