title: How to click on an image and update the view count?
body: <p>I have a simple code:</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
       var count = 0;
       function changevar(){
               count = count + 1;
           document.getElementById("viewCount").textContent=count;
        }
    &lt;/script&gt;
  
   &lt;button onclick="changevar()"&gt;Add view&lt;/button&gt;
   &lt;p&gt;View: &lt;span id="viewCount"&gt;0&lt;/span&gt;&lt;/p&gt;
  </code></pre>
  
  <p>I click the button, and the view text is updated! Great.</p>
  
  <p>The problem is when I reload the page, the count goes back to 0.</p>
  
  <p>1) How can I keep the count where it was?
  2) And how can I change the button, for an image</p>
  
  <pre><code> &lt;button onclick = ( for something like an image ) &lt;/button&gt;
  </code></pre>
  
  <p>Thank you for all your help.</p>