Sure - you want to attach a listener to the link and call preventDefault
to prevent the default behavior of the link (which is to redirect).
Without using jQuery:
element.addEventListener('click', function(e) {
e.preventDefault();
// Filter
});
Using jQuery:
// jQueryObject holds the selected set of element(s)
jQueryObject.on('click', function(e) {
e.preventDefault();
// Filter
});