Javascript: Ability to filter classes