let div = document.querySelector("div");
if (window.innerWidth > 768) {
div.addEventListener("mouseover", function () {
console.log("works");
});
} else if (window.innerWidth < 768) {
div.addEventListener("click", function () {
console.log("works");
});
}