I've tried to use one single button to change background color of a div but failed. could anyone help me please.
var colourBox = ["Red", "blue", "green", "yellow", "purple", "pink"];
    
for(var c = 0; c < 6; c++;) {
    $(".btns1").click(clorChange);
    function clorChange() {
        $(".top_div").css('background-color', colourBox[c]);
        alert(colourBox[c]);
    }
}
 
    