I would just like to have an editable div that acts like a text box that focuses on page loading (i.e. a blinking cursor is visible, and text input is displayed in a div without having to select a div with the mouse). I tried calling focus () on an editable div, but this does not work.
I'm not sure you can control the cursor, but you can just focus the element:
function initPage() { var elEd = document.getElementById('editor'); elEd.contentEditable=true; elEd.focus(); }
Chrome, ID - , . Firefox , , . .
Source: https://habr.com/ru/post/1745589/More articles:Drawing a relative line in C # - c #Editing a 1 MB file continuously, which is more efficient? - javaiPhone SDK: data synchronization - sqlHow to combine an existing row with new data in SQLite? - sqlWhat is the best HTML web editor that allows you to upload an image to the server when you paste it? - asp.netВопросы о переходе от mysql к PDO - phpUse AJAX to reload captcha - javascriptETL, Esper or Drools? - springMVC 2 Pass View to Controller to generate Excel file on the fly - asp.net-mvcDjango RadioButtons with icons and no shortcut? - djangoAll Articles