+ 3
why "addEventListener()" is not working in Sololearn App
7 Answers
+ 4
The link opens using SoloLearn app, does not open using web browser.
In short, addEventListener was invoked before the DOM was completely constructed. The element is not yet there, and thus you get the error message.
You can wrap the JS code in a window load event handler.
window.onload = () =>
{
// your code here
}
+ 4
You will find the answer in this post đ
https://www.sololearn.com/post/90825/?ref=app
+ 2
Thanks đ but it works on web version of sololearn
+ 2
I'm guessing there's a difference in how script is processed between SoloLearn app and web.
+ 2
Thanks a lot bro đđ it's working nowđđ
+ 1
You have a try that adding event listener on the html page within script tags.
That works for međ