In my case, I had a condition when the user click the "a" element. The condition was:
If other section had more than ten items, then the user should be not redirected to other page.
If other section had less than ten items, then the user should be redirected to other page.
The functionality of the "a" elements depends of the other component. The code within click event is the follow:
var elementsOtherSection = document.querySelectorAll("#vehicle-item").length;
if (elementsOtherSection> 10){
return true;
}else{
event.preventDefault();
return false;
}