Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
/ query Public archive

Simple abstraction to querySelectorAll for a more performant and intuitive solution

License

Notifications You must be signed in to change notification settings

ryanmorr/query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

query

Solution for leveraging the performance benefits of getElementById, getElementsByTagName, and getElementsByClassName for simple CSS selectors when querying the DOM. Please refer to http://ryanmorr.com/abstract-away-the-performance-faults-of-queryselectorall for more detailed information regarding this project.

Usage

Usage mimics that of your standard selector engine, accepting any CSS selector to query the DOM. The context of the query can be limited by providing a DOM element as an optional second argument:

query('#foo');
query('.foo');
query('.foo.bar');
query('div', element);

An array rather than a node list is returned, making available all the methods of the Array prototype.

License

This project is dedicated to the public domain as described by the Unlicense.

About

Simple abstraction to querySelectorAll for a more performant and intuitive solution

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published