Responsive Content Filter JavaScript

jimfrenette profile image Jim Frenette Originally published at jimfrenette.com ・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


Editor guide