How can I change the color of a div based on whether it is currently red or green?
I attempted the following code, but it doesn't seem to be working as expected.
if ($(this).css("background-color")=="rgb(34,187,69)"|| $(this).css("background-color")=="rgb(255,0,51)") {
var s = confirm("Are you sure you want to pushback?");
if (s == true) {
$(this).css("background-color","#ffffff");
}
Can anyone verify if this code is correct?