getelementsbyid

1.0.0 • Public • Published

getElementsById

A simple library for selecting multiple elements by id.

This function slightly resembles document.getElementById except you can pass indefinite number of ids and function returns an array with your selected elements.

Also works seamlessly with array destructuring.

Basic example with array destructuring

import getElementsById from "getelementsbyid";
 
const [nav, article] = getElementsById("nav", "article");

Readme

Keywords

none

Package Sidebar

Install

npm i getelementsbyid

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

2.13 kB

Total Files

5

Last publish

Collaborators

  • raichlsimon