function initializeCounterComponent(container) { | |
var boton = container.querySelector("#counterClick"); | |
var title = container.querySelector("h1"); | |
if (boton) { | |
boton.addEventListener("click", (e) => { | |
console.log("click JavaScript"); | |
let button = e.target; | |
button.innerHTML = "Hello"; | |
title.innerHTML = "The button has been clicked!"; | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment