how to disable html div click code example
Example 1: disable div click
// 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
Example 2: disabled a click
// CSS
.not-active {
pointer-events: none;
cursor: default;
text-decoration: none;
color: black;
}
// HTML
<a href="link.html" class="not-active">Link</a>