In my JQuery/JS I'm doing a check and changing the background color and border color of a button, it works fine in IE but in Chrome, Chrome doesn't set the color back to grey. IE changes, just not Chrome. When I look in the debugger at the rendered html it doesn't add the coloring, it's just not there!!! Funny thing is it adds the disabled property in Chrome, so the line of Jquery code that sets the color back to grey is def being called!
Here is my button, I initialize it with grey and being disabled
<button id="eventRegister" type="button" class="btn btn-lg btn-yb footer-button" style="background-color: grey !important; border-color: grey !important; display: none;" disabled>Register</button>
Then with a checkbox on the page for 'terms and services' I enable it and remove the grey color. But if the user un checks the checkbox and resets the button back to grey, in Chrome, it doesn't change the color. IE is fine!
$("#registerEventTerms").off('change').on('change', function () {
if (this.checked)
$("#eventRegister").css('background-color', '').css('border-color', '').prop('disabled', false);
else
$("#eventRegister").css('background-color', 'grey !important').css('border-color', 'grey !important').prop('disabled', true);
});
FYI - I'm thinking it has something to do with my class 'btn-yb' located in my site.css file, that has these properties, but not sure
.btn-yb {
background-color: #008489 !important;
color: white !important;
}
.btn-yb:hover,
.btn-yb:focus {
color: white !important;
}
.btn-yb.disabled,
[disabled].btn-yb,
fieldset[disabled] .btn-yb {
opacity: 1;
}