JS Dodaj słuchacz kliknięcia
document.getElementById("myBtn").addEventListener("click", function() {
alert("Hello World!");
});
Batman
document.getElementById("myBtn").addEventListener("click", function() {
alert("Hello World!");
});
document.getElementById("ELEMENT_ID").addEventListener("click", function() {
//insert here the code to be executed
});
const element = document.querySelector(".class__name");
element.addEventListener("click", () => {
console.log("clicked element");
});