Remebering the last value passed to a JavaScript function called on click
<p>I have a simple JavaScript question.</p>

<p>Below is my code fragment:</p>

<pre><code>&lt;div onclick = "myClick('value 1')"&gt;
    button 1
&lt;/div&gt;
 &lt;div onclick = "myClick('value 2')"&gt;
    button 2
&lt;/div&gt;
</code></pre>

<p>Basically when I for each click on a different div, a different value will be passed to the JavaScript function. </p>

<p>My Question is how can I keep track of the value passed in the previous click? </p>

<p>For example, I click "button 1", and "value 1" will be passed to the function. Later, I click on "button 2", I want to be able to know whether I have clicked "button 1" before and get "value 1".</p>

<p>Please help, thank you in advanced.</p>
