code: function getSelectionParentElement() {
          var parentEl = null,
              selection;
  
          if (window.getSelection) {
              selection = window.getSelection();
              if (selection.rangeCount) {
                  parentEl = selection.getRangeAt(0).commonAncestorContainer;
                  if (parentEl.nodeType !== 1) {
                      parentEl = parentEl.parentNode;
                  }
              }
          } else if ((selection = document.selection) && selection.type !== 'Control') {
              parentEl = selection.createRange().parentElement();
          }
  
          return parentEl;
      }
docs: /*
  GetSelectionParentElement