OLD | NEW |
1 <script> | 1 <script> |
2 function test() | 2 function test() |
3 { | 3 { |
4 if (window.testRunner) | 4 if (window.testRunner) |
5 testRunner.dumpAsText(); | 5 testRunner.dumpAsText(); |
6 var ta = document.getElementById("ta"); | 6 var ta = document.getElementById("ta"); |
7 ta.focus(); | 7 ta.focus(); |
8 document.execCommand("InsertLineBreak"); | 8 document.execCommand("InsertLineBreak"); |
9 var result = ta.value; | 9 var result = ta.value; |
10 if (result == "\n") | 10 if (result == "\n") |
11 document.write("<p>Hooray, the test was successful!</p>"); | 11 document.write("<p>Hooray, the test was successful!</p>"); |
12 else | 12 else |
13 document.write("<p>The test failed, result was '" + result.replace("\n",
"\\n") + "'.</p>"); | 13 document.write("<p>The test failed, result was '" + result.replace("\n",
"\\n") + "'.</p>"); |
14 } | 14 } |
15 </script> | 15 </script> |
16 <body onload="test()"> | 16 <body onload="test()"> |
17 <p><textarea id="ta"></textarea></p> | 17 <p><textarea id="ta"></textarea></p> |
OLD | NEW |