function getParents(element) {
        var parents = [];
        while (element.parentNode) {
          if (element === document.body) {
            return parents;
          }
          var children = element.parentNode.children;
          for (var i = 0; i < children.length; i++) {
            // skip over child if it is an ascendant of the dialog
            // a script or style tag, or a live region.
            if (element !== children[i] &&
                !isNodeOneOf(children[i], ['SCRIPT', 'STYLE']) &&
                !children[i].hasAttribute('aria-live')) {
              parents.push(children[i]);
            }
          }
          element = element.parentNode;
        }
        return parents;
      }
function getParents(element) {
        var parents = [];
        while (element.parentNode) {
          if (element === document.body) {
            return parents;
          }
          var children = element.parentNode.children;
          for (var i = 0; i < children.length; i++) {
            // skip over child if it is an ascendant of the dialog
            // a script or style tag, or a live region.
            if (element !== children[i] &&
                !isNodeOneOf(children[i], ['SCRIPT', 'STYLE']) &&
                !children[i].hasAttribute('aria-live')) {
              parents.push(children[i]);
            }
          }
          element = element.parentNode;
        }
        return parents;
      }
function getParents ( element ) { var parents = [ ] ; while ( element . parentNode ) { if ( element === document . body ) { return parents ; } var children = element . parentNode . children ; for ( var i = 0 ; i < children . length ; i ++ ) { // skip over child if it is an ascendant of the dialog // a script or style tag, or a live region. if ( element !== children [ i ] && ! isNodeOneOf ( children [ i ] , [ 'SCRIPT' , 'STYLE' ] ) && ! children [ i ] . hasAttribute ( 'aria-live' ) ) { parents . push ( children [ i ] ) ; } } element = element . parentNode ; } return parents ; }
Get all of an element's parent elements up the DOM tree
@return {Array} The parent elements
Get all of an element s parent elements up the DOM tree
get parents of element