cmb Posted October 19, 2011 Share Posted October 19, 2011 This is what i would like to do and i have no idea how to, pleas help i want to get the value of a text box add 1 to it and then update what that text box says Quote Link to comment Share on other sites More sharing options...
Adam Posted October 19, 2011 Share Posted October 19, 2011 Can you show the mark-up you're working with? There's a number of ways to do it. Quote Link to comment Share on other sites More sharing options...
cmb Posted October 19, 2011 Author Share Posted October 19, 2011 After i posted this i acutally figured this out but i was wondering if their was a better way of doing it <form id="form6" name="form6" method="post" action=""> <input name="gsavebtn" type="button" id="gsavebtn" value="Saves" onClick="add()"/> <input name="gsave" type="text" id="gsave" value="0" size="2" readonly /> </form> <script type="text/javascript"> function add() { var bm = document.getElementById('gsave').value; var am = bm * 1 + 1; document.getElementById('gsave').value = am; localStorage.setItem( "gsave", am ) } </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.