Miss any of our Open RFC calls?Watch the recordings here! »

dom-previous-element-sibling

1.0.0 • Public • Published

dom-previous-element-sibling

Install

npm install --save dom-previous-element-sibling

Usage

import previousElementSibling from 'dom-previous-element-sibling';
 
let element = document.querySelector('ol').children[1];
console.log(element.innerHTML);//Second
let first = previousElementSibling(element);
console.log(first.innerHTML);//First

About

IE before IE9 doesn't support element.previousElementSibling. This module is a ponyfill for that.

Also see dom-next-element-sibling.

Install

npm i dom-previous-element-sibling

DownloadsWeekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar