+ 3
Anyone can answer what is the error occuring??
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
+ 5
This may shine some extra light on what is the cause of your problems.
https://code.sololearn.com/WcdoF4PGPyDC/#html
+ 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
}
0
First define your function out of onclick event then use it in your events , it should be works