title: HTML/Javascript Button Click Counter
body: <p>I have done something similar to this before, and I know this is really close. I'm just trying to make it so that my button increments the javascript variable, and the function then displays the new value.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Space Clicker&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;script type="text/javascript"&gt;
      int clicks = 0;
      function click() {
          clicks += 1;
          document.getElementById("clicks").innerHTML = clicks;
      };
      &lt;/script&gt;
      &lt;button type="button" onClick="click()"&gt;Click me&lt;/button&gt;
      &lt;p&gt;Clicks: &lt;a id="clicks"&gt;0&lt;/a&gt;&lt;/p&gt;
  
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>