There is a menu. The user followed the link in the menu. How to disable this link?

    1 answer 1

    <div class="menu"> <a href="http://test.com/asd">asd</a> <a href="http://test.com/def">def</a> </div> 

     var x=document.getElementsByClassName('menu')[0],i=0; for(;i<x.length;i++) if(window.location.href==x[i].href) x[i].className='current-item';