dom-array

Turn any* input into array (of DOM nodes).

Usage no npm install needed!

<script type="module">
  import domArray from 'https://cdn.skypack.dev/dom-array';
</script>

README

dom-array

Turn any* input into array (of DOM nodes).

Build Status

Input formats:

  • window
  • document
  • Element
  • NodeList
  • Array
  • String
  • undefined
  • null

Usage

var $ = require('dom-array');

$(); // []
$('title'); // [title]
$('title', document.body); // []
$('<title>'); // [title]

Installation

$ npm install dom-array

Test

$ npm test

Browser support

IE9+