What?
Dizzle turns CSS selectors into functions that tests if elements match them. When searching for elements, testing is executed "from the top", similar to how browsers execute CSS selectors.
Features:
- Full implementation of CSS3 & CSS4 selectors
- Partial implementation of jQuery extensions
- Pretty good performance
Usage
Get Dizzle From jsDelivr and use it like this:
<script src="https://cdn.jsdelivr.net/npm/dizzle/dist/dizzle.umd.min.js"></script>
<script>
var divs = dizzle('div');
console.log(divs);
</script>
Dizzle is also available through npm as the dizzle
package:
npm install --save dizzle
That you can then use like this:
import dizzle from "dizzle";
dizzle.find('div.myelement');
Documentation
Finding Elements
/**
* Search For h2 elements inside div in whole document
*/
console.log(dizzle('div > h2'));
/**
* Fetches
…