1<!DOCTYPE html> 2<html> 3<body> 4<textarea id='target' rows='2' cols='3'> 5 simple text that should be a bit longer than that 6</textarea> 7<script> 8 var textarea = document.getElementById('target'); 9 textarea.focus(); 10 textarea.setSelectionRange(0, textarea.value.length); 11</script> 12</body> 13</html> 14