29th May 2020, 5:58 AM
Priyanshu Gupta(प्रियांशु गुप्ता)
Priyanshu Gupta(प्रियांशु गुप्ता) - avatar
1 ответ
0
1) it works if you put the script in the html: <html> <head><title></title></head> <body></body> <script>YOUR CODE HERE...</script> </html> 2) you have bad references in the variables, because you declare a variable into a function but you want to use in another function where the variable doesn't exists. You need to declare outside the function: You have this: function x{ var example = 1; } function y{ example = 2; } but the function Y doesn't know what is "example" So you need to declare outside the function: var example = 1; function x{ example++; } function y{ example++; }
30th May 2020, 10:15 AM
Luis E. Gómez Mena
Luis E. Gómez Mena - avatar