I currently have a website located at . However, I am looking to change the background colors of the cards (when flipped) to random colors.
My current approach is shown below:
<script>
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 15)];
}
return color;
}
$(function() {
$(".face,.back").each(function() {
$(this).css("background-color", get_random_color());
});
});
</script>
However, this script does not update multiple classes as intended. I need it to update ".face.back " but it seems to be malfunctioning. Any assistance or suggestions would be greatly appreciated!