I would like to disable onclick
event with CSS. Possible?
Let's say I have
<div id=btnCopy class=button onclick=btnCopy(this);><img src=copy.png></div>
and by adding class disabled
document.getElementById(btnCopy).className += disabled;
I would like to turn off onclick event for this element, so onclick=btnCopy(this);
would not be active.
And by removing disabled class
document.getElementById(btnCopy).className =
document.getElementById(btnCopy).className.replace(/(?:^|s)disabled(?!S)/, '');
it would go back to normal, so onclick
event will be active.