JSFiddle - React, Tailwind, and code Playground

by viktorb

HTML

<div id="rightScrollRegion" class="ScrollRegion">
    DIV
</div>

JavaScript

document.getElementById('rightScrollRegion').addEventListener("mouseover", scrollLeft);
document.getElementById('rightScrollRegion').addEventListener("mouseout", scrollRight);

function scrollLeft(){         
    document.getElementById('rightScrollRegion').style.background = "#0000ff";
}

function scrollRight(){
    document.getElementById('rightScrollRegion').style.background = "#ff0000";
}