Placed
input[disabled] {pointer-events:none}
in your CSS (it prevents some browsers from completely discarding clicks on disabled inputs) and capturing a click on the parent element. This is a cleaner IMHO solution than overlaying a transparent overlay on an element to capture a click, and depending on the circumstances, it can also be much easier than just โmimickingโ the disabled state using CSS (as this will not hurt, but also requires redefining the browser style, disabled by default.
If you have several of these buttons, for each of them you will need a unique parent element to be able to distinguish which button was pressed, because with pointer-events:none goal of the click is the parent button, not the button itself, (Or โโyou can check the coordinates of the click, I suppose ...).
If you need to support older browsers, check which of them support pointer-events : http://caniuse.com/#search=pointer-events
source share