Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <form action="http://www.w3schools.com/jsref/form_action.asp"> A hidden field:<input type="hidden" id="myInput" name="country" value="Norway"><br> <input type="submit" value="Submit"> </form> <p>Notice that the hidden field above is not shown to a user.</p> <p>Submit the form to see the value of the name and value attribute of the hidden input field, as received input.</p> <p>Click the "Try it" button to change the value from "Norway" to "USA".</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myInput").value = "USA"; document.getElementById("demo").innerHTML = "The value of the value attribute was changed. Try to submit the form again."; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_hidden_value3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:33:01 GMT --> </html>
Result:
Try it Yourself - © w3schools.com