You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Björn b963b3396c
init
4 years ago
..
LICENSE init 4 years ago
README.md init 4 years ago
index.js init 4 years ago
index.next.js init 4 years ago
package.json init 4 years ago

README.md

bianco.query

Build Status NPM version NPM downloads MIT License

Modern DOM query selectors helpers written in es2015

Usage

import $ from 'bianco.query'

const footer = document.querySelector('.main-footer')
const header = document.querySelector('.main-header')

// convert DOM nodes to arrays
$(footer)
  .concat($(header))
  .forEach(el => el.classList.add('fade-in'))

// handle DOM queries
$('h1', 'main').forEach(h1 => h1.classList.add('main-title'))

API

Table of Contents

$

Simple helper to find DOM nodes returning them as array like loopable object

Parameters

  • selector (string | DOMNodeList) either the query or the DOM nodes to arraify
  • ctx HTMLElement context defining where the query will search for the DOM nodes

Returns Array DOM nodes found as array