Set TextArea to be Active
<html> <body> <script language="JavaScript"> function function1() { document.all.myTextArea.setActive(); } </script> <textarea id="myTextArea">Some text</textarea> <input type="button" value='Insert the cursor inside the textarea' onclick="function1();"> </body> </html>