title: JavaScript - retain "textbox2" value for it to be available after refresh/reopen page
body: <p>I have 2 textboxes. After writing something in the first one and clicking the OK button the value appears in textbox2 also.
  I need that value to be saved after page refresh and not be modified untill someone introduces a new value in textbox1 and hits OK again. </p>
  
  <pre><code>&lt;html&gt; 
  &lt;head&gt; &lt;/head&gt; 
  
  &lt;script type="text/javascript"&gt;
  function myfunction() 
      { 
       var first = document.getElementById("textbox1").value;
  
       var textbox2 = document.getElementById("textbox2");
       textbox2.value = first;
  
      } 
  &lt;/script&gt;
  
   &lt;body&gt; 
  &lt;input type="text" name="textbox1" id="textbox1" /&gt;
  &lt;input type="submit" name="button" id="button1" onclick="myfunction()" value="OK" /&gt;
  &lt;br/&gt;
  Your answer is:
  &lt;input type="text" name="textbox2" id="textbox2" readonly="true"/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>