document.querySelector("button").addEventListener("click", handle); function handle() { alert("I got clicked") }