Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <form action="http://www.w3schools.com/jsref/form_action.asp"> <input type="checkbox" id="myCheck" name="vehicle" value="Bike" checked> I have a bike<br> <input type="submit" value="Submit"> </form> <p>Submit the form to see the value of the name and value attribute of the checkbox, as received input (the checkbox must be checked, or nothing is returned).</p> <p>Click the "Try it" button to change the value from "Bike" to "newCheckboxValue".</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myCheck").value = "newCheckboxValue"; 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_checkbox_value3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:32:24 GMT --> </html>
Result:
Try it Yourself - © w3schools.com