1// To disable:
2document.getElementById('id').style.pointerEvents = 'none';
3// To re-enable:
4document.getElementById('id').style.pointerEvents = 'auto';
5// Use '' if you want to allow CSS rules to set the value
1// CSS
2.not-active {
3 pointer-events: none;
4 cursor: default;
5 text-decoration: none;
6 color: black;
7}
8
9// HTML
10<a href="link.html" class="not-active">Link</a>