Old post but none of the solutions worked for me. I figured it out eventually though:
var div = document.getElementById('contenteditablediv');
setTimeout(function() {
div.focus();
}, 0);
More Related Contents:
- jquery Setting cursor position in contenteditable div
- Dealing with line Breaks on contentEditable DIV
- Set Focus After Last Character in Text Box
- trigger an event when contenteditable is changed
- How to select an element that has focus on it with jQuery
- Selecting text on focus using jQuery not working in Safari and Chrome
- Access the css “:after” selector with jQuery [duplicate]
- jQuery hasAttr checking to see if there is an attribute on an element [duplicate]
- Select which href ends with some string
- SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3
- jQuery – checkbox enable/disable
- What’s the difference between jQuery .live() and .on()
- Getting URL hash location, and using it in jQuery
- Is jQuery $.browser Deprecated?
- how to deal with google map inside of a hidden div (Updated picture)
- How can I run a directive after the dom has finished rendering?
- jQuery UI Datepicker onchange event issue
- $.focus() not working
- jqGrid – saving checkbox selected state
- How to insert close button in popover for Bootstrap
- jQuery select change show/hide div event
- jQuery .on(‘click’) vs. .click() and .delegate(‘click’)
- Bootstrap 3 jquery event for active tab change
- jQuery Validate Ignore elements with style
- How to change column name in column chooser pop up in jqgrid?
- Check if class already assigned before adding
- jquery function val() is not equivalent to “$(this).value=”?
- map() get() confusion
- Why is the window.width smaller than the viewport width set in media queries
- jQuery CSS() for dynamically created elements