1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<html>
<head>
<script>
function test() {
var ta = document.getElementById('ta');
ta.focus();
// Send caret to bottom of textarea
ta.setSelectionRange(ta.value.length, ta.value.length);
document.execCommand("InsertText", false, '5');
document.execCommand("InsertText", false, '\n');
document.execCommand("InsertText", false, '6');
document.execCommand("InsertText", false, '\n');
document.execCommand("InsertText", false, '7');
document.execCommand("InsertText", false, '\n');
document.execCommand("InsertText", false, '8');
document.execCommand("InsertText", false, '\n');
}
</script>
</head>
<body onload="test()">
This tests that a scrollbar will appear when text overflows the textarea
<br>
<textarea rows=6 id="ta">
1
2
3
4
</textarea>
</body>
</html>
|