Javascript examples for DOM HTML Element:Input Reset
The value property sets or gets the value attribute of the reset button, which is the the text that is displayed on the reset button.
Set the value property with the following Values
Value | Description |
---|---|
text | The text displayed on the reset button |
A String, representing the text displayed on the reset button
The following code shows how to change the text displayed on a Reset button:
<!DOCTYPE html> <html> <body> <input type="reset" id="myReset" value="Reset form"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/* ww w.j a v a 2 s . co m*/ document.getElementById("myReset").value = "newResetButtonValue"; } </script> </body> </html>