mus mus - 1 year ago 71
CSS Question

Highlight button when radio button is checked

I am trying to highlight a save button once one of three radio buttons are checked.

Then once the user clicks the save button, it should lose the highlight class and return to normal, the user can also click the cancel button and the save button will lose the highlight effect.

$('label').click(function() {
if ($('.greyBtn').data('clicked', true)) {
} else if ($('.cancel').data('clicked', true)) {

Right now it only highlights the save button upon radio button check, it will not lose the class again, when i click the buttons.


Answer Source

You can use click functions to do this. here is my fiddle

$('label').click(function() {
   $('.greyBtn').click(function() {
  $('.cancel').click(function() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download