What I want to do is that when the user presses a button, that’s button’s color will change (to something different for each button).
I tried doing it by adding a class to the button (you can see an example of this with the first button), but when I run it it won’t add the class to the button. But the first command in the function ($("#symptomFlagTextField").val(“1”); ) works perfectly.
Sorry, that was a typo while trying various solutions.
I added the hash back in and it still doesn’t work :/. And I added an alert command to test it out, and it doesn’t work, so it seems when I click the button the only function that works is the val one :S
EDIT
I tried adding a class to a random div inside the modal the buttonGroup is in, and it also didn’t work for that. I was wondering if something is wrong with jQuery, but the .val() function is working so that’s not it.
EDIT 2
FIXED.
Turns out inside the string from onClick => $string I can only use a single javascript command. It’s really weird, and I have no idea why that is (maybe a more experienced user can explain it to me, and for everyone who in the future my stop by this thread).
Anyway, I just built a seperate js script with a function dothis() inside, and I changed the onClick to: