title: What's the best way to set cursor/caret position?
body: <p>If I'm inserting content into a textarea that TinyMCE has co-opted, what's the best way to set the position of the cursor/caret?</p>
  
  <p>I'm using <code>tinyMCE.execCommand("mceInsertRawHTML", false, content);</code> to insert the content, and I'd like set the cursor position to the end of the content.</p>
  
  <p>Both <code>document.selection</code> and <code>myField.selectionStart</code> won't work for this, and I feel as though this is going to be supported by TinyMCE (through something I can't find on their forum) or it's going to be a really ugly hack.</p>
  
  <p><strong>Later:</strong> It gets better; I just figured out that, when you load TinyMCE in WordPress, it loads the entire editor in an embedded iframe.</p>
  
  <p><strong>Later (2):</strong> I can use <code>document.getElementById('content_ifr').contentDocument.getSelection();</code> to get the selection as a string, but not a Selection Object that I can use <code>getRangeAt(0)</code> on. Making progress little by little.</p>