+ 2
Event Listener not working...
The addEventListener method, which I have added to two of my codes listed, is not working in Code Playground even though it's working on my desktop. I have no idea why... This is the code :- something.addEventListener('input', myFunction ); https://code.sololearn.com/WJFaA5BO3TAx/?ref=app https://code.sololearn.com/WQgkhGe4GkiL/?ref=app Thanks in advance 🙂
1 Resposta
+ 5
Sololearn put the codes of Javascript pane in head tag.
so Sololearn Javascript pane code is run from head tag before DOM elements loaded.
You can't run DOM access code directly there, set window.onload callback function instead.