I've encountered a strange issue while using the addEventListener method on an HTMLElement within a function that is triggered onload. The problem is that the method seems to be getting executed before I even attempt to click on the element in the HTML page.
function setConfigurationMenu(){
var navConfigure = document.querySelector(".navConfigure");
var navBody = navConfigure.querySelector(".body");
var navTop = navConfigure.querySelector(".top");
navTop.addEventListener("click", alert("jow"));
}
This behavior is puzzling, does anyone have any insights into what might be happening here?
Thanks,