javascript onclick counter intializes to 0 on refresh
<p>I have a button in my JSP,</p>

<pre><code>&lt;input type="button" id="processItem" name="_eventId_submitButton" value="Submit" onclick="submitClick();buttonClick();"&gt;&lt;/input&gt;
</code></pre>

<p>my javascript,</p>

<pre><code>var clicks = 0;
 function submitClick(){
            var aButton = document.getElementById('submithidden');
            aButton.click();    
            return true;
        }        
     function buttonClick(){
         document.getElementById('clicked').value = ++clicks;
         }  
</code></pre>

<p>this is where I am showing the counts of <code>submit</code></p>

<pre><code>    &lt;tr&gt;&lt;td&gt;&lt;p&gt;Total No of Scans&lt;input type="text" id="clicked" size="3" 
onfocus="this.blur();" value="0" &gt;.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>

<p>everytime I click on submit, counter shows 1 and immediately the page refreshes and again it becomes 0. I want to keep it incremented untill the user leaves the page!</p>
