Disable link with CSS. If you want to disable the link from clicking than this simple CSS will do the trick rather than writing a javascript. <a href="link.html" class="not-active">Link</a> .not-active { pointer-events: none; cursor: default; }