function elementHasFocus(el) {
      var activeEl = document.activeElement;
      if (!el || !activeEl || activeEl === document.body) {
        return false;
      }
      var outermost = $container[0].parentNode;
      while (activeEl && activeEl !== outermost && activeEl !== document.body) {
        if (activeEl === el) {
          return true;
        }
        activeEl = activeEl.parentNode;
      }
      return false;
    }
// Return TRUE when the element itself or any of its child nodes has focus.
Return TRUE when the element itself or any of its child nodes has focus.
Return TRUE when the element itself or any of its child nodes has focus .
function elementHasFocus(el) {
      var activeEl = document.activeElement;
      if (!el || !activeEl || activeEl === document.body) {
        return false;
      }
      var outermost = $container[0].parentNode;
      while (activeEl && activeEl !== outermost && activeEl !== document.body) {
        if (activeEl === el) {
          return true;
        }
        activeEl = activeEl.parentNode;
      }
      return false;
    }
function elementHasFocus ( el ) { var activeEl = document . activeElement ; if ( ! el || ! activeEl || activeEl === document . body ) { return false ; } var outermost = $container [ 0 ] . parentNode ; while ( activeEl && activeEl !== outermost && activeEl !== document . body ) { if ( activeEl === el ) { return true ; } activeEl = activeEl . parentNode ; } return false ; }
Return TRUE when the element itself or any of its child nodes has focus.
Return TRUE when the element itself or any of its child nodes has focus .