+ 1
2 Answers
+ 2
C#Coder
First thing class name should not have dot(.)
2nd thing write code inside window.onload function
window.onload = function() {
const button = document.querySelector(".button");
button.onclick = function () {
alert("hello!");
}
}
0
Thanks