Skip to content

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

Notifications You must be signed in to change notification settings

wessberg/node.parentelement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published