V
V
Viper2282015-10-04 18:33:07
JavaScript
Viper228, 2015-10-04 18:33:07

How to complete the game in js?

Here is the Clicker game code!

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <script href=""></script>
  <title>document</title>
</head>

<body>

<h2></h2>
<div id="result"></div>
<div class="home" onclick="gag()" style="background: red; width: 200px; height: 200px;"></div>
  <script>
document.getElementById("result").innerHTML = localStorage.clickcount;
function gag() {
    if(typeof(Storage) !== "undefined") {
        if (localStorage.clickcount) {
            localStorage.clickcount = Number(localStorage.clickcount)+1;
        } else {
            localStorage.clickcount = 1;
        }
        document.getElementById("result").innerHTML = localStorage.clickcount;
    } 
}
  </script>
</body>
</html>

How to make an auto-click feature! and for example there is a block when clicked removes 10 points and when you click on the block we will get 2 points, not 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
littleguga, 2015-10-04
@Viper228

Here is an example for you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question