why wont this code work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why wont this code work?

<html> <head> <title>Snow Clicker</title> <h3><button onclick="snowClick(1)">shovel</button> snow: <span id="money">0</sapn> <h3>snow upgrades</h3> <p>shovel: <span id="shovel">0</span> </head> <body> <button onclick+"buyShovel()">Buy Shovel</button> Cost: <span id=beginnercost">10</span> <script> var money = 0; function snowClick(number){ money = money + number; document.getElementById("money").innerHTML = money; }; var shovel = 0; function buyshovel(){ var beginnercost = Math.floor(10 * Math.pow(3.2,Beginner)); if (money>= beginnerCost){ beginner = beginner +0.1; money = money - beginnercost: document.getElementById('beginner').innerHTML = beginner; document.getElementById('money').innerHTML = money }; var next cost = math.floor(10 * Math.pow(3.2,beginner)); document.getElementById('nextCost'). innerHTML = nextCost; }; windows.setInterval(function(){ snowclick(beginner); }, 1000}; </script> </body>beginnercost </html>

6th Jun 2017, 2:58 PM
Nathaniel Givens
12 Answers
+ 2
First off: include <!DOCTYPE HTML> at the top. Does it work then?
6th Jun 2017, 3:11 PM
Maart
Maart - avatar
+ 2
Okay make your code public please and share the link + specify what's not working
6th Jun 2017, 3:17 PM
Maart
Maart - avatar
+ 2
https://code.sololearn.com/W019KKxoYhL0/?ref=app Fixed a few typos, missing semicolons etc. Just look at the errors they are giving you, often it's like 'Line 35: missing )', then add one in that line. What did you mean to do with: windows.******* at line 35?
6th Jun 2017, 3:24 PM
Maart
Maart - avatar
+ 2
how is going to work on a java playground?
6th Jun 2017, 3:24 PM
_Retr0/-
_Retr0/- - avatar
+ 2
Yeah, you got HTML code set at Java, change the language to Web
6th Jun 2017, 3:25 PM
Maart
Maart - avatar
+ 1
before
6th Jun 2017, 3:15 PM
_Retr0/-
_Retr0/- - avatar
+ 1
wait lemme check
6th Jun 2017, 3:16 PM
_Retr0/-
_Retr0/- - avatar
6th Jun 2017, 3:17 PM
_Retr0/-
_Retr0/- - avatar
+ 1
wait! what?
6th Jun 2017, 3:24 PM
_Retr0/-
_Retr0/- - avatar
0
do I do it before of after html
6th Jun 2017, 3:14 PM
Nathaniel Givens
0
no it didn't work
6th Jun 2017, 3:16 PM
Nathaniel Givens
6th Jun 2017, 3:23 PM
Nathaniel Givens