I want to find anchor tags with same hrefs on the current page
For example I have three anchor tags of same href on the current page like
<a href="https://www.link.com" class="btn btn-cta">
The class will be same for all the buttons.
Sorry i forgot to update my code which is updated
$("a").each(function(){
if ($(this).attr("href") == window.location.pathname){
}
});
Is there any better way of doing this.
Any help or suggestion would be appreciated
Thanks in advance