Set the disabled attribute to true in js and jquery to invalidate the button.
If the disabled attribute is set to true, It is unavailable.
JS
Document. getElementByIdx ("btn"). disabled = true;
Jquery
$ ("# Btn"). attr ("disabled", true );
Html
<Input type = "button" value = "Submit" id = "btn">
How to Use jQuery to add the disabled attribute to a button. After the button becomes grayed out, clicking this button can still trigger the event.
After the button is disabled, the event will not be triggered again.
Analysis should be caused by event bubbling. · check whether the parent element has a click event!
You can use e. stopPropagation (); To organize event bubbles ·
Come on ··
Invalid js control button
General process:
1. Get Button Object
2. Set the disabled attribute of the button object to true (disabled) or false (disabled)
Example:
ButtonObject = document. getElementById ('btnobj ');
ButtonObject. disabled = true;