Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLTextAreaElement / reset-textarea.html
blobd63aa5aa8173697f8b9f51ee0be6be6b9f0ce6f4
1 <html>
2 <head>
3 </head>
4 <body>
5 <form>
6 <textarea id="noDefaultText"></textarea>
7 <textarea id="hasDefaultText">Default Text</textarea>
8 <input id="resetButton" type="reset">
9 </form>
10 <p>This test verifies that textarea controls are properly reset.
11 <br>You should see two element IDs below, and the word "SUCCESS" twice:
12 <script>
13 function test(element)
15 var result = "FAILED";
16 if (element.value == element.defaultValue)
17 result = "SUCCESS";
18 document.writeln("<br>" + element.id + ": " + result);
20 var noDefaultText = document.getElementById("noDefaultText");
21 var hasDefaultText = document.getElementById("hasDefaultText");
22 noDefaultText.value = "Not the default value.";
23 hasDefaultText.value = "Not the default value.";
24 document.getElementById("resetButton").click();
25 test(noDefaultText);
26 test(hasDefaultText);
27 </script>
28 </body>
29 </html>