title: Getting selected html content in tinymce editor
body: <p>I have created a custom button using this code</p>
  
  <pre><code>    setup : function(ed) {
      ed.addButton('Tittle', {
                  title : 'Tittle',
                  image : './images/T.jpg',
                  onclick : function() {
                  ed.focus();
              var c = ed.selection.getNode().nodeName;
          if(c!="TITTLE")
          {
               ed.selection.setContent('&lt;tittle&gt;' + ed.selection.getContent() + '&lt;/tittle&gt;');
  
          }
          else
          {
  
          }
  }
          });
  </code></pre>
  
  <p>When a user select a text and click on the new button, i want to add a <code>&lt;title&gt;</code> tag at beginning  and ending, if <code>&lt;tittle&gt;</code> tag is not their.If <code>&lt;tittle&gt;</code> tag is already their in the selected text i want to remove the tag</p>