Clever idea by François Zaninotto. Add to the searchable element a data-index
attribute which contains all the text content of its children smooshed together. Then you can find matches using the [data-index*=""]
selector, which is fast. Essentially doubles the DOM weight, but that’s rarely too big of a deal.
Client-side full-text search in CSS
DigitalOcean provides cloud products for every stage of your journey. Get started with $200 in free credit!