Retrieving a closest node to the caret position
<p>I have a document (inside editable iframe),<br>
I need to retrieve a closest node to the caret position, not the parent node, but the sibling node (so they must have same parent) that is located (when available) left to the caret position(collapsed selection).</p>

<p>The node can be any node, like text node, paragraph, div and etc.<br>
Note: the browser is <strong>not</strong> IE.</p>

<p>I have this for now:</p>

<pre><code> var content = document.getElementById('iframedocument').contentWindow;
 var selection = content.getSelection();
 var range = selection.getRangeAt(0);
</code></pre>
