mishamyrt-noquery
v3.0.0
Published
Teenie-weenie jQuery–like $ function for DOM queries
Downloads
3
Readme
noQuery
A function for elements selection in 71 ASCII chars.
import { $ } from 'mishamyrt-noquery'
const title = $('h1')
If only one element is found, the function will return it. Otherwise, it will return an array with all native methods.
const handleClick = () => alert('Whoops')
const isRed = n => n.classList.contains('__red')
// Set click callback to all red buttons
$('.button')
.filter(isRed)
.forEach(n => n.addEventListener('click', handleClick))