OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <style> | 4 <style> |
5 .text { | 5 html { |
6 font-family: courier; | 6 font: 10px Ahem; |
7 font-size: 12px; | 7 -webkit-font-smoothing: none; |
8 padding: 0px; | |
9 margin: 0px; | 8 margin: 0px; |
10 border: 0px; | |
11 } | 9 } |
| 10 textarea { |
| 11 font: 10px Ahem; |
| 12 -webkit-font-smoothing: none; |
| 13 margin: 0px; |
| 14 position: absolute; |
| 15 left: 200px; |
| 16 top: 250px; |
| 17 } |
| 18 |
12 </style> | 19 </style> |
13 </head> | 20 </head> |
14 <body> | 21 <body> |
15 <textarea id='target' class="text" type='text' rows="3" cols="20"> | 22 <textarea id='target' class="text" type='text' rows="3" cols="20"> |
16 First Line | 23 First Line |
17 Second Text Row | 24 Second Text Row |
18 </textarea> | 25 </textarea> |
19 <script> | 26 <script> |
20 function selectCaret() { | |
21 var text = document.getElementById('target'); | |
22 text.focus(); | |
23 text.setSelectionRange(17, 17); | |
24 } | |
25 function selectRange() { | 27 function selectRange() { |
26 var text = document.getElementById('target'); | 28 var text = document.getElementById('target'); |
27 text.focus(); | 29 text.focus(); |
28 text.setSelectionRange(1, 3); | 30 text.setSelectionRange(1, 3); |
29 } | 31 } |
30 </script> | 32 </script> |
31 </body> | 33 </body> |
32 </html> | 34 </html> |
33 | 35 |
OLD | NEW |