title: JavaScript - Count Number of Visitor for Website
body: <p>I am new to JavaScript, How do i increment the number whenever the page is refreshed on the browser. Client Implementation only :)</p>
  
  <p>Here is my html code:</p>
  
  <pre><code>&lt;div id="CounterVisitor"&gt;
            &lt;span class="counter-item"&gt;0&lt;/span&gt;
            &lt;span class="counter-item"&gt;0&lt;/span&gt;
            &lt;span class="counter-item"&gt;1&lt;/span&gt;
            &lt;span class="counter-item"&gt;1&lt;/span&gt;
            &lt;span class="counter-item"&gt;8&lt;/span&gt;
            &lt;span class="counter-item"&gt;4&lt;/span&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My JavaScript: </p>
  
  <pre><code>var counter = 001184;
  var newnum = 001184 + 1;
  
  var el = document.getElementsByClassName("counter-item");
  el.innerHTML = newnum;
  </code></pre>
  
  <p>This is how the result will look like when i refresh the browser, but it is static for now.</p>
  
  <p><a href="https://i.stack.imgur.com/RR44V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RR44V.png" alt="enter image description here"></a></p>