+ 1
Why the error in the code.
I used for selection method in javascript and its showing an error. https://code.sololearn.com/W8sl0Mr606fz/?ref=app
8 odpowiedzi
+ 2
Chysomm🤩🇳🇬("inActive")
You need to get the value when you call the function.
+ 2
Chysomm🤩🇳🇬("inActive")
Yes but you are trying to get value before loading of html document. You must know that javascript loads before the html document.
+ 2
Chysomm🤩🇳🇬("inActive")
Check what I did
https://code.sololearn.com/WCMkFsMs6mW4/?ref=app
+ 1
AJ #Learn With Me 👨💻 okay, will do that.. and get back to you here
+ 1
AJ #Learn With Me 👨💻 I called the function in the html document
+ 1
Chysomm🤩🇳🇬("inActive")
One more thing if you are calling your functions on any event then no need to write functions inside
document.addEventListener("DOMContentLoaded
+ 1
AJ #Learn With Me 👨💻
Great, thank you
0
AJ #Learn With Me 👨💻
Used the DOMContentLoaded event listener but still an error