I have a div with overflow: scroll; And I would like to put a button. When you press it, the content of the div scrolls.
overflow: scroll;
div
Something like:
Rather than do
function scrollDiv(){ document.getElementById("d").scrollTop += 100; document.getElementById("d").scrollLeft += 100; }
would you not do
document.getElementById("d").scrollBy({ top: 100, left: 100, behaviour: 'smooth' })