document.querySelector('block-wrapper').addEventListener('wheel', event => {
event.preventDefault()
this.mouseWheel(event)
})
mouseWheel(event) {
horizontTransform -= event.deltaY
document.querySelector('block').style.transform = `translateX(${horizontTransform}px)`
}
// Add an abortable event listener to table
const controller = new AbortController();
const el = document.getElementById("outside");
el.addEventListener("click", modifyText, { signal: controller.signal } );
// Function to change the content of t2
function modifyText() {
const t2 = document.getElementById("t2");
if (t2.firstChild.nodeValue == "three") {
t2.firstChild.nodeValue = "two";
} else {
t2.firstChild.nodeValue = "three";
controller.abort(); // remove listener after value reaches "three"
}
}