How to remove scroll for anchor tag hash click in javascript or jquery


Staff member
I am using wordpress visual composer tabs in my wordpress theme, I am also using same tab menus in Wordpress main menu with hastags like #mylink. When I click on that anchor tag in menu I given page reload option. But before page reload it is scrolling down for it's related content of that tab content.
Here is the code that I am using

$('.sub-menu .menu-item a').click(function(e) {
     location = this.href;


I want to remove the scroll when you click on the the hashed anchor tag.

for reference URL: <a href="" rel="nofollow"></a>