1document.getElementById("myBtn").addEventListener("click", function() {
2 alert("Hello World!");
3});
1const element = document.querySelector(".class__name");
2
3element.addEventListener("click", () => {
4 console.log("clicked element");
5});
1element.addEventListener("click", function(){
2 element.innerText = "something";
3});