Remove JQuery dependency.
Replace the Array.filter by a partition function.

The parition function avoid changing the style of the same DOM element twice.