Input Reset value Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Reset

Description

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

Return Value

A String, representing the text displayed on the reset button

The following code shows how to change the text displayed on a Reset button:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials