Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Clicking Game Template</title>
  </head>
  <body>
    <h1>Super Cool Clicking Game</h1>
    <h3 id="scoreCount">score: </h3>
    <h3 id="pointsCount">points: </h3>
    <h3 id="multiplierCount">multiplier: </h3>
    <button id="primaryButton" onclick="handleButtonClick()">click me</button>
    <button id="upgradeClicker" onclick="handleUpgradeClick()">
      Upgrade Clicker
    </button>
    <button id="darkModeUpgrade" onclick="handleDarkModeClick()">
      Dark Mode cost: 50
    </button>
    <script src="index.js"></script>
  </body>
</html>
 
let score = 0;
let points = 0;
let multiplier = 1;
let upgradeCost = 50;
function handleButtonClick() {}
function handleUpgradeClick() {}
function handleDarkModeClick() {}
function updateScores() {
  let scoreDisplay = document.getElementById("scoreCount");
  scoreDisplay.textContent = "score: " + score;
  let pointsDisplay = document.getElementById("pointsCount");
  pointsDisplay.textContent = "points: " + points;
  let multiplierDisplay = document.getElementById("multiplierCount");
  multiplierDisplay.textContent = "multiplier: " + multiplier;
  let upgradeButton = document.getElementById("upgradeClicker");
  upgradeButton.textContent = "upgrade cost is " + upgradeCost;
}
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers