+ 3
How to disable a button or div
6 Answers
+ 5
<button disabled>Disable button</button>
+ 3
display: hidden
+ 3
You can do something like:
if(activated){
//do your stuff
}
The activated variable can be used to control if the button / div should do an action or not.
You can make another function like "deActivate" to make the activated variable false, and in the same function you can do your CSS skills to make it look like it's inactive
+ 2
That also works
+ 1
I don't want to hide it , I just want that they should be visible but not clicked
+ 1
delete event from js
by default div and button have no click events