OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script type="text/javascript"> | |
5 function log(msg) | |
tkent
2014/05/07 00:54:39
Please remove this and use debug() in ../../resour
yosin_UTC9
2014/05/07 01:06:22
I recommend to use "resources/js-test.js". It prov
harpreet.sk
2014/05/07 11:57:54
Done.
harpreet.sk
2014/05/07 11:57:54
Done.
| |
6 { | |
7 document.getElementById('res').innerHTML = document.getElementById('res').in nerHTML + msg + "<br>"; | |
8 } | |
9 | |
10 function testSelection() | |
11 { | |
12 if (window.testRunner) { | |
tkent
2014/05/07 00:54:39
We prefer early return.
if (window.testRunner
harpreet.sk
2014/05/07 11:57:54
Done.
| |
13 testRunner.dumpAsText(); | |
14 var firstInput = document.getElementById('val1'); | |
tkent
2014/05/07 00:54:39
Wrong indentation.
harpreet.sk
2014/05/07 11:57:54
Corrected.
| |
15 var secondInput = document.getElementById('val2'); | |
16 firstInput.selectionStart = 3; | |
17 firstInput.selectionEnd = 5; | |
18 firstInput.value = "Parsed"; | |
19 secondInput.selectionStart = 3; | |
20 secondInput.selectionEnd = 5; | |
21 secondInput.value = "P"; | |
22 log('First Input - Slection start: ' + firstInput.selectionStart + ' and end: ' + firstInput.selectionEnd); | |
23 log('Second Input - Slection start: ' + secondInput.selectionStart + ' and end: ' + secondInput.selectionEnd); | |
24 } | |
25 } | |
26 </script> | |
27 </head> | |
28 <body onload="testSelection()"> | |
29 <input id="val1" type="text" /> | |
30 <input id="val2" type="text" /> | |
31 <div id="res"></div> | |
32 </body> | |
33 </html> | |
OLD | NEW |