+ 5
Adding an event listener
What is the problem with this js code i can't figure it out. I don't know how to ask it in a question. https://code.sololearn.com/WpodOJewvFu5/?ref=app
3 Answers
+ 8
since js is loaded and executed first (unless you invoke it not to or add script tag after body), it does not know what the document has.
wrap your DOM code inside a window.onload event so
window.onload = () => {
// your code
}
+ 5
PUT your js code inside
window.onload=function()
{
}
here's a good reference
https://www.sololearn.com/post/7444/?ref=app
+ 3
「HAPPY TO HELP」, Hima
thank you it worked!
Hot today
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
3 Votes
Python palindrome challenge.
1 Votes
Java
0 Votes
Number of Ones ( C++ ) question!
1 Votes
For Moderators
1 Votes