+ 2
what is problem with this code
im trying to change the button textcontent with event delegation please tell me whats wrong with this code https://code.sololearn.com/WE4AvR4S3a6H/?ref=app
3 ответов
+ 6
Do you mean the error it's giving at line 2? If yes then it's because the JS part is getting loaded before the html window and hence it can't find the required element. Write your entire JS code inside a function which will be called once the html window gets loaded.
You can do it like:
window.onload=function(){
//your JS code goes here
}
+ 5
daneillonge it does work here
+ 2
it works on other ide but solo doesnt support event handler properly