There is a menu. The user followed the link in the menu. How to disable this link?
<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';
Source: https://ru.stackoverflow.com/questions/168454/More articles:Dynamic class connectionData in inputReturn value by main functionEvent-oriented programmingChoosing Kohana 3 Route for PaginationHow to make a beautiful text?Question on the length of links in robots.txtHow to upload a file from HDD to GitHub repository?Get the contents of the loaded fieldThe function of loading a file from memory and the function of writing to a fileAll Articles