blob: d63aa5aa8173697f8b9f51ee0be6be6b9f0ce6f4 [file] [log] [blame]
<html>
<head>
</head>
<body>
<form>
<textarea id="noDefaultText"></textarea>
<textarea id="hasDefaultText">Default Text</textarea>
<input id="resetButton" type="reset">
</form>
<p>This test verifies that textarea controls are properly reset.
<br>You should see two element IDs below, and the word "SUCCESS" twice:
<script>
function test(element)
{
var result = "FAILED";
if (element.value == element.defaultValue)
result = "SUCCESS";
document.writeln("<br>" + element.id + ": " + result);
}
var noDefaultText = document.getElementById("noDefaultText");
var hasDefaultText = document.getElementById("hasDefaultText");
noDefaultText.value = "Not the default value.";
hasDefaultText.value = "Not the default value.";
document.getElementById("resetButton").click();
test(noDefaultText);
test(hasDefaultText);
</script>
</body>
</html>