+ 1
Is there an attribute which dont allows to press a button
For example I want to click on button after which we cant never touch it again & onclick it will no do a func which i mentioned
8 Respostas
+ 3
Why not just remove the function after the first click through a call to "removeEventListener()":
https://www.sololearn.com/learn/JavaScript/2758/
Another method would be to set the CSS "pointerEvents" attribute to "none", I think:
https://www.w3schools.com/cssref/css3_pr_pointer-events.asp
+ 5
<button type="button"disabled>Click Me!</button>
disabled attribute of button will be also helpful.
Thank you
+ 1
$("#btnSubmit").attr("disabled", true);
For adding
$("#btnSubmit").attr("disabled", false);
For removing
Inform me when this runs
0
Thanks a lot
0
How can I add disabled attribute using jquery or js
0
Using jquery u can use .attr() function for adding the attribute to the button.
0
setup jquery in your html document otherwise code of #sanchay will not work
- 1
But disabled tag isnt adding i tryed