code: function addParentNodeInterfaceToPrototype(p) {
      Object.defineProperty(p, "firstElementChild", {
        get: function firstElementChild() {
          var el = this.firstChild;
          while (el && el.nodeType !== 1) {
            el = el.nextSibling;
          }
          return el;
        },
      });
  
      Object.defineProperty(p, "lastElementChild", {
        get: function lastElementChild() {
          var el = this.lastChild;
          while (el && el.nodeType !== 1) {
            el = el.previousSibling;
          }
          return el;
        },
      });
  
      Object.defineProperty(p, "childElementCount", {
        get: function childElementCount() {
          var el = this.firstElementChild;
          var count = 0;
          while (el) {
            count++;
            el = el.nextElementSibling;
          }
          return count;
        },
      });
    }
docs: This polyfill has been tested with IE 11 and 10. It has not been tested with older versions of IE because we do not support them.