on click disable html 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: On click, disable button
$("#btnSubmit").attr("disabled", true);