Created
May 17, 2020 01:09
-
-
Save gavilanch/f84d782b9889ad327243f297fd29e43b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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