i have designed html 5 + javascript mobile webpage. in page have button called "submit". when clicked it-button value changed "done". if refresh page after clicking "submit" button, default value button("submit") appears.
what need once clicked button,it's value should "done" though user refreshes page. there specific method this?
<style> .selectbtn{height:60px;width:80px; background-color:yellow;} #abc{background-color:gray;height:100%;width:60%;} </style> </head> <body><div id='abc'></div> <script> content = document.getelementbyid('abc'); function dx(){ var btn = document.createelement('button'); btn.type = 'button';btn.classname = 'selectbtn'; btn.innerhtml = 'submit'; btn.onclick = function() { this.innerhtml='done'; } content.appendchild(btn); } dx(); </script>
you may store information if button clicked, in cookie. can set , read cookie javascript , disable button if cookie exists or has particular value. easy-cheatable, user can delete or modify cookies. if need more reliable, need store on server side.
Comments
Post a Comment