0

I have a contenteditable element like this:

<p id="editor" contenteditable="true">Ok I am an element.</p>

How do I set the cursor in the element to wherever the mouse pointer is?

None of my attempted methods work:

$("#editor").click();
$("#editor").focus();
theonlygusti
  • 11,032
  • 11
  • 64
  • 119
  • Possible duplicate of [Set cursor position on contentEditable
    ](http://stackoverflow.com/questions/1181700/set-cursor-position-on-contenteditable-div)
    – SLePort Dec 03 '16 at 07:18
  • `focus` only focuses the div it cannot do that on containing text data – Vinay Dec 03 '16 at 07:31

0 Answers0