node.parentelement

A spec-compliant cross-browser polyfill for Node.parentElement

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
node.parentelement
1.0.27 years ago7 years agoMinified + gzip package size for node.parentelement in KB

Readme

Node.parentElement polyfill

A spec-compliant polyfill for Node.parentElement. It adds support for it in IE <8.
It also normalizes the behavior between different browsers. Some, like Internet Explorer >=9 and Opera <=12 have implemented the method only on Elements while others have implemented it on all Nodes. Node is undefined in IE8. This polyfill makes sure that it always works on all types that implements Node such as Attr and Text.

Install

Install with
npm install node.parentelement --save-dev

Usage

Load it in your code with an import statement:
import "node.parentelement";
Or from a script tag:
<script src="../node_modules/node.parentelement/polyfill.min.js"></script>

The polyfill will be applied automatically if necessary.