title: html print variable value
body: <p>Right now I have this code and I would like to print on the screen(not a pop up) the value of how many times the button has been clicked. I think i would set a var index = 0 and increment it each time it is clicked... but I am not sure how to change the variable value on the screen. For instance, right now it has been clicked 0 times. When I click the button I want the value over there &lt;-- (0) to become 1. I might have to put a blank picture in white over it and then reprint the value of index... </p>
  
  <p>Also.. I would like this to be ALL IN HTML.. if possible, no php or javascript please.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function getVote(int)
  {
  if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
  else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
      document.getElementById("poll").innerHTML=xmlhttp.responseText;
      }
    }
  xmlhttp.open("GET","poll_vote.php?vote="+int,true);
  xmlhttp.send();
  
  
  if(typeof(Storage)!=="undefined")
    {
    if (localStorage.clickcount)
      {
      localStorage.clickcount=Number(localStorage.clickcount)+1;
      }
    else
      {
      localStorage.clickcount=1;
      }
    document.getElementById("result").innerHTML="You have voted " + localStorage.clickcount + " times before this session";
    }
  else
    {
    document.getElementById("result").innerHTML="Sorry, your browser does not support web storage...";
    }
  }
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body bgcolor=#5D003D&gt;
  &lt;div id="poll"&gt;
  
  &lt;p&gt;Click the button to see the counter increase.&lt;/p&gt;
  &lt;p&gt;Close the browser tab (or window), and try again, and the counter will continue to count (is not reset).&lt;/p&gt;&lt;form&gt;
  &lt;input type="Button" class="voteButton" name="vote" value="Vote" onclick="getVote(this.value)" /&gt;
  &lt;/form&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>