Answers for "how to prevent an element from being clicked"

3

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
Posted by: Guest on April-11-2020
0

prevent from going to a function html click

$("#clickable a").click(function(e) {
   // Do something
   e.stopPropagation();
});
Posted by: Guest on July-03-2020

Code answers related to "how to prevent an element from being clicked"

Browse Popular Code Answers by Language