element-hasclass

Tiny zero dependency helper module to check if element(s) have a particular class

Usage no npm install needed!

<script type="module">
  import elementHasclass from 'https://cdn.skypack.dev/element-hasclass';
</script>

README

element-hasclass

Tiny zero dependency helper module to check if element(s) have a particular class

This emulates jQuery's hasClass behaviour: it works for multiple elements, and even works in awful browsers.

hasClass(elements, 'class-to-check');

Installation and usage

Grab from NPM

npm install element-hasclass

And import it

import hasClass from 'element-hasclass';

Or grab the minified JavaScript from unpkg

<script src="https://unpkg.com/element-hasclass"></script>