Easy Tutorial
❮ Prop Text Value Jsref Toprecision ❯

Reset value Attribute


Definition and Usage

The value attribute sets or returns the value of the value attribute of a reset button.

The value attribute specifies the text displayed on the reset button.

Syntax

Set the value attribute:

Return the value attribute:


Browser Support

All major browsers support the value attribute.


Example

The following example prompts the text displayed on the reset button:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<script>
function displayResult(){
    var x=document.getElementById("reset1").value;
    alert(x);
}
</script>
</head>
<body>

<form>
Email: <input type="text" id="email">
<input type="reset" id="reset1" value="Reset form">
</form>
<button type="button" onclick="displayResult()">Display the value of the reset button</button>

</body>
</html>

❮ Prop Text Value Jsref Toprecision ❯