Let's say someone clicks on:
<a href="#" class="filter">Stillness Furniture</a>
The link in the browser will just go to whatever.com/page/#
Here is the code housing that link:
<nav id="portfolio-filter">
<ul>
<li class="filter"><a href="#" class="filter">View All</a></li>
<li class="filter"><a href="#" class="filter">Stillness Furniture</a></li>
</ul>
</nav>
I want the link to go to #portfolio-filter instead of just #, now obviously I could change the link href, but this is a WordPress theme and editing it would mean I have to change it every time I update the theme.
How would I be able to make the browser jump down to id#portfolio-filter when someone clicks that link?
Something like this is all I have so far?
$(document).on("click", "a.filter", function(){
//do something
});
(taken from Onclick function based on element id)
Thanks in advance for any help.