I have styled a button using the following CSS class:
.disabled{
pointer-events: none ;
opacity: 0.6 ;
}
Despite being disabled, I can still interact with it dynamically through JavaScript. However, my issue arises when using the keyboard to reach the button and inadvertently clicking it.
Is there a way to disable keyboard events or prevent focus events through CSS? Ideally, I would like to simply add and remove the class from the button as needed. Thank you for any assistance.