code: function( containerNode )
      {
          if( getSelectionCollapsed( containerNode ) )
              return null;
          var sel = window.getSelection();
          if( sel.rangeCount )
          {
              var container = document.createElement('div'),
                  len = sel.rangeCount;
              for( var i=0; i < len; ++i )
              {
                  var contents = sel.getRangeAt(i).cloneContents();
                  container.appendChild(contents);
              }
              return container.innerHTML;
          }
          return null;
      }
docs: http://stackoverflow.com/questions/4652734/return-html-from-a-user-selected-text/4652824#4652824