Ata Posted November 6, 2013 Share Posted November 6, 2013 I got this code now. <script type="text/javascript"> document.write("<input type='text' value='' onclick='alert('message')' />"); document.write("<input type='text' value='' onclick='alert('message')' />");document.write("<input type='text' value='' onclick='alert('message')' />");</script> How can I save this on my server with local storage? I want if I type something in the input field that I can save it, and when I refresh it is still there. Link to comment Share on other sites More sharing options...
thescientist Posted November 6, 2013 Share Posted November 6, 2013 have you read the documentation on local storage? http://www.html5rocks.com/en/features/storage It doesn't store it on the server, it stores it on the client (i.e. the users browser). This may be the same means to and end for you, depending on your requirements. More importantly, I would question your use of document.write. Any particular reason you are using it instead of just an HTML document with the elements already on the page? Link to comment Share on other sites More sharing options...
Ata Posted November 8, 2013 Author Share Posted November 8, 2013 No, I thought it might work. But I have another code now. But thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now