xxxxxxxxxx
// CSS
.not-active {
pointer-events: none;
cursor: default;
text-decoration: none;
color: black;
}
// HTML
<a href="link.html" class="not-active">Link</a>
xxxxxxxxxx
<style>
/* Apply pointer-events: none to disable click */
.disabled-div {
pointer-events: none;
}
</style>
<div class="disabled-div">
<!-- Content of the disabled div -->
</div>
xxxxxxxxxx
// To disable:
document.getElementById('id').style.pointerEvents = 'none';
// To re-enable:
document.getElementById('id').style.pointerEvents = 'auto';
// Use '' if you want to allow CSS rules to set the value