After clicking a button, I included the following jQuery code in a code snippet on my WordPress site:
jQuery("#cf_course_planner tr").css("background-color", "#f66");
jQuery("#cf_course_planner tr:eq(0)").css("background-color", "#fff");
if (confirm("Confirm deletions of all entries\nEither OK or Cancel.") == true){
alert("You pressed OK!");
} else {
return false;
}
However, the background color does not change until after pressing the OK button on the alert. How can I get the background-color to change before the confirm request?
I attempted using a console.log command just to trigger an action, but it did not work as expected.