| var ta = document.getElementById('ta'); |
| // 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'); |
| This tests that a scrollbar will appear when text overflows the textarea |
| <textarea rows=6 id="ta"> |