@hisho/query-selector
TypeScript icon, indicating that this package has built-in type declarations

0.9.4 • Public • Published

querySelector

Features

  • typescript
  • vanilla js

Contents

Install

$ npm i @hisho/query-selector

Usage

querySelector() - string | NodeListOf<Element> | HTMLElement | HTMLElement[] | null

import {querySelector} from "@hisho/query-selector";

const dom = querySelector('div');

if(dom.exists) {
  dom.all.forEach((item) => {
    console.log(item);
  });
}

API

all

return - HTMLElement[]

querySelector('div').all; //[div,div,...] or []

exists

return - boolean

querySelector('div').exists; //true or false

License

MIT © hisho

Readme

Keywords

none

Package Sidebar

Install

npm i @hisho/query-selector

Weekly Downloads

2

Version

0.9.4

License

MIT

Unpacked Size

16.8 kB

Total Files

40

Last publish

Collaborators

  • hisho