title: CKEDITOR :: Get selected text's parent node
body: <p>I am working in CKEditor right now.And I have a Question for You guys.</p>
  
  <p>I am Selecting particular text in CKEditor's Text area and getting the selected </p>
  
  <p>nodes HTML content Using the Below code.</p>
  
  <pre><code> var editor = CKEDITOR.instances.editor1;
   var sel = editor.getSelection();
   sel.selectElement(sel.getStartElement());
   var ranges = sel.getRanges();
   var el = new CKEDITOR.dom.element("div");
  
     for (var i = 0, len = ranges.length; i &lt; len; ++i) {
               el.append(ranges[i].cloneContents());
                    }
    alert(el.getHtml());
  </code></pre>
  
  <p>The following returuns the currently selected text HTML content.          </p>
  
  <pre><code>alert(el.getHtml());
  </code></pre>
  
  <p>My Question is How I get the selected node's parent tag?</p>
  
  <p><strong>Example</strong></p>
  
  <p>Example Word is,  </p>
  
  <pre><code>&lt;p&gt;hi&lt;b&gt;welcome&lt;/b&gt;world&lt;p&gt;
  </code></pre>
  
  <p>My Selection is,</p>
  
  <pre><code>&lt;b&gt;welcome&lt;/b&gt;
  </code></pre>
  
  <p>How do i get the below parent tag.</p>
  
  <pre><code>&lt;p&gt;&lt;/p&gt;
  </code></pre>