0

how could i save my textbox value in localmemory if possible? thanks for help

addOne = function(){ document.myForm.inputbox.value = document.myForm.inputbox.value*1 + 1 ; }
   <form name="myForm" action="" method=""> 
<input name="inputbox" readonly type="text" id="textarea" value="0" style="border-radius:15px; font-size:100;border-color:black;font-family:hotdog; color:white; border: 0px none;background-color:#0099FF;"></form>



</div>
    <div style="width:800px; margin:0 auto;">
        <img src="diamond.
  png"  width="700"onclick="addOne()" class="change">
Antonio Erdeljac
  • 2,974
  • 1
  • 17
  • 24
  • I'm not sure what you're trying to do - is this along the lines of "If I fill the form in and submit, show the form again but save some/all of the values?" eg if I try to login with my username and password, it clears the password field but retains my username? – Jon Story Sep 18 '14 at 14:47
  • im simply trying to make my website remembers how much time i clicked and shows it in the textbox so for example it shows 192 but i have no idea how to do that since my value is always 0 – Antonio Erdeljac Sep 18 '14 at 14:52

1 Answers1

0

If you want to make it persistent across page refreshes and so on, you should use cookies, here you have a good example:

How do I create and read a value from cookie?

Community
  • 1
  • 1
Maxim Hash
  • 405
  • 4
  • 19
  • Thank you very much for the response, this seems like it could work. The only problem is that i am a complete beginner with javascript and all these get.Date() things really confuse me could you somehow explain to me how can i use it on my code? thanks in advance :) – Antonio Erdeljac Sep 18 '14 at 16:12