I have a button; when I click the button I want my function to get a random image (using colors temporarily) I know the code in my function works, but when I try to call the function from the .click event the function doesn't seem to work any help would be greatly appreciated.
function getRandomImage() {
if ($("#imageContainer").css("background-color", "black") == $("#imageContainer").css("background-color", "black")) {
$("#imageContainer").css("background-color", "red");
}
}
$("#mainButton").click(function(){
getRandomImage();
});
I know I'm missing something/doing something off, please help :)