0
AddEventListener Problem!
AddEventListener Problem! How can I fix it? Please help me. https://code.sololearn.com/W2Qq2MY2Tp9B/?ref=app
3 Answers
+ 3
Nur Efşan Şimşek
Function name should start from small character.
Also write js code inside window.onload function
window.onload = function () {
document.querySelector('button')
.addEventListener('click', () => {
alert('Hello guys, how are you?')
})
}
https://code.sololearn.com/WMOPto3x77nE/?ref=app
+ 2
Read this post to understand
https://www.sololearn.com/post/90825/?ref=app
+ 2
Thank you 🙏🏻