index.js
// returns true if the element is contained within a document
returns true if the element is contained within a document
returns true if the element is contained within a document
function connectedToTheDom(node) {
      var container = node.ownerDocument.contains ? node.ownerDocument : node.ownerDocument.body;
      return container.contains(node);
    }
function connectedToTheDom ( node ) { var container = node . ownerDocument . contains ? node . ownerDocument : node . ownerDocument . body ; return container . contains ( node ) ; }
returns true if the element is contained within a document
returns true if the element is contained within a document
// IE does not have contains method on document element, only body   