I want to place a cursor by default in a textarea.The editor is in a hidden div, and when a button is clicked, the div displays. Instead of making the user click in the editor to begin typing, I want the editor focused so they can start adding content immediately.
not getting focus in textarea.
Collapse
X
-
-
Comment
-
Code:<div id="editorDiv" style="display:none;"> <textarea id="myEditor" name="myEditor" cols="30" rows="6"></textarea></div>
Code:var container = document.getElementById("editorDiv"), editor = document.getElementById("myEditor"); container.style.display="block"; editor.focus();
Comment
Comment