JSFiddle - React, Tailwind, and code Playground

by antisanity

HTML

<div>test test test test</div>

JavaScript

$("div").on({
    mousemove: function (e) {        
        $(this).css("background-color", e.offsetX <= 10 ? "red" : "white");
    },
    mouseout: function (e) {
        $(this).css("background-color", "white");
    }
});