I\'m trying to get both my final Alert message \"Congratulations...\" and the HTML background color change to happen simultaneously. The color change happens after
The next line of your javascript will not run until after the alert box has been dismissed. Instead of using an alert() you could use console.log() which would not pause execution.
EDIT: My bad, you want the user to see it. As a commenter suggested below, simply change the background color before showing the alert().