You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

next-node

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

next-node

Get the next Node Element, with optional container restriction.

1.0.3
latest
Source
npm
Version published
Maintainers
1
Created
Source

next-node Build Status

Get the next Node Element, with optional container restriction.

Install

$ npm install --save next-node

Usage

<div id="a1">
	<div id="b1"></div>
	<div id="b2"></div>
</div>
<div id="c1"></div>
const nextNode = require('next-node');

nextNode(a1);
//=> b1

nextNode(b1);
//=> b2

nextNode(b2);
//=> c1 (container not specified)

nextNode(b2, a1);
//=> null (container specified)

API

nextNode(node, [container])

node

Type: Node

The initial ("needle") Node element.

container

Type: Node
Default: null

The container ("haystack") Node element. Specifying a container will limit results to its children only.

License

MIT © Luke Edwards

Keywords

next child

FAQs

Package last updated on 12 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts