If I have an HTML list like this:
<div id="my-list">
<ul class="list">
<li data-cat="fish">Cod</li>
<li data-cat="fish">Salmon</li>
<li data-cat="bird">Crow</li>
</ul>
</div>
Is it possible to filter it based on the contents of the data-cat
attribute using List.js?
All the examples I've seen only allow searching/filtering based on visible HTML content, but I'd like to filter based on the content of a data
element, as here, or maybe the list item's class
. I can't see how to do this though.