Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>test окда</title> </head> <body> <style type="text/css"> p { font-size: 24px; } </style> <p>Money: <span id="moneytext">0</span></p> <button onclick="upg1_Buy()">Buy 1 Worker<br>+1 $/s<br>Select Count: <input title="1" id="upg1_count"></input></button> <script type="text/javascript"> var money = 0; var money_getting = 1; var upg1_count = 0; var upg1_price = 50; var upg1_multiplier = 0; document.getElementById("upg1_count").value = 1; function MoneyIncreasing() { money += money_getting + (upg1_multiplier); document.getElementById("moneytext").innerHTML = money; } function upg1_Buy() { for (var i = 0; i > document.getElementById("upg1_count").value - 1; i++) { if (money > upg1_price - 1) { money -= upg1_price; upg1_count += 1; upg1_multiplier += 1; } } } setInterval(MoneyIncreasing, 1000); </script> </body> </html>