0
Could you help me? I need to know what happens in this example to not use onclick in html
3 odpowiedzi
+ 7
Use it .
window.onload=function(){
var muestra = document.querySelector(".boton");
muestra.addEventListener("click", function(){
alert("bien hecho");
});
}
0
Excellent! Thanks a lot.
0
it's better this way, right?
window.addEventListener("load", function(){
var muestra = document.querySelector(".boton");
muestra.addEventListener("click", function(){
alert("bien hecho");
});
});