0
Resolve
https://code.sololearn.com/WdU7tJmFQXaj/?ref=app i tried my best
1 Respuesta
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++;
}