mus mus - 1 month ago 6x
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.



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

$('label').click(function() {
   $('.greyBtn').click(function() {
  $('.cancel').click(function() {