Tag - Filter method in JavaScript