Override greyed out effect of element

jquery

Solution

Via CSS:

One solution is to set the same style for disabled and enabled buttons using the `button[disabled]` css selector like this:

button[disabled], button{
        color:#fff;
        border: none;
        background-color: grey;
    }

The problem is that browsers have different styles for buttons by default, so you will need to style your buttons.

Via Jquery:

Another solution is to remove the click event handler to the buttons, so replace this line:

$("button").attr("disabled", "disabled");

for this one:

$('button').off('click');

To enable the click event again use:

$('button').on('click');

More info about add/remove events handler on this good answer at SO

Note: You should add id for the buttons (if you are using more than one) because the code above will remove the click on all your buttons.

Problem

I have this line of jQuery which disables all buttons once an event has been triggered. ``` $("button").attr("disabled", "disabled"); ``` Disabled buttons are greyed-out by default, but I was wondering if there was a way to override this behaviour so that the buttons are disabled, but with no indication to the user? Thanks.

Original source

Related problems