scan-for-attr

0.0.1 • Public • Published

Scan For Attr

This finds the top level attributes of a given segments of a dom tree.

Usage

var scan = require('scan-for-attr');
 
scan('data-block', document.body);
// return an array or null depending if any are found

This will find the first dom node with the attribute 'data-block'. The idea is that you may want to stop there and do something with that node. This intended to be used recursively so if you need lower level attribute just pass the DOM node into the function again and it will scan for more.

Building

The actual development file is in src/index.js it is then transcompiled to es5. You can do this by running npm run dist

Examples

To get a fresh build of the examples run npm run exmaples. Then just open up the index.html in the directory.

Readme

Keywords

none

Package Sidebar

Install

npm i scan-for-attr

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • ~jcblw