+ 3

Anyone can answer what is the error occuring??

https://code.sololearn.com/W0hn6fSPvqN7/?ref=app

17th May 2020, 12:43 PM
ayush dixit
ayush dixit - avatar
4 Answers
+ 4
another alternative would be to put all your JS code inside the HTML tab between <script> here </script> right above the enclosing body tag (also delete the code from your JS tab after) sometimes window.onload doesn't work for me so i keep the JS code in the HTML tab
17th May 2020, 1:14 PM
Sebastian Pacurar
Sebastian Pacurar - avatar
+ 5
This may shine some extra light on what is the cause of your problems. https://code.sololearn.com/WcdoF4PGPyDC/#html
17th May 2020, 8:18 PM
ODLNT
ODLNT - avatar
+ 3
It works for me (on iOS) which makes me think you need to wrap your entire JS tab in window.onload = function() { //everything here }
17th May 2020, 12:56 PM
Russ
Russ - avatar
0
First define your function out of onclick event then use it in your events , it should be works
18th May 2020, 10:52 PM
Amir Hossein mahdioun
Amir Hossein mahdioun - avatar