node.parentelement
v1.0.2
Published
A spec-compliant cross-browser polyfill for Node.parentElement
Downloads
309
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.