The button has been pushed 0 times.



<p>The button has been pushed <span id="counter">0</span> times.
<p><button type="button" onclick="increment()"> Click Me! </button>

    <script>
      var numclicks = 0

      function increment() {
        numclicks = numclicks + 1
        document.getElementById('counter').innerHTML = numclicks
      }
    </script>