DEV Community


Responsive Content Filter JavaScript

Jim Frenette
UI engineer interested in all things dev
Originally published at ・1 min read

This code sample shows how to create a responsive list filter using plain JavaScript (no jQuery). JavaScript gets the breakpoint value from a hidden css pseudo element that uses a media query to set its value. Therefore, it is not necessary to maintain rendundant responsive breakpoint values in the script.

All of the code is available to edit and demo in our online sandbox.


jQuery version

Discussion (0)