Wednesday 20 June 2012

Disable a button using CSS

__________________________________________________________


Disabling a button is actually disabling event on button, CSS is use to style elements like Divs, buttons etc. But in CSS we can use some sort of firefox hack to disable events on button.
IE does not support "pointer-event: none". Other browsers like Firefox, safari and chrome support.

Add ".active" class to the button.


.active {
   pointer-events: none;
   cursor: default;
}


your code would be like
<input type="image" id="ButtonId" name="buttonName" class="active"/>



No comments:

Post a Comment