I have a webpage with colored boxes that look like this:

Each box has it's own div, the first one having an id of "one", second one being "two", and so on. It is supposed to be a guessing game where if you click the correct box you win, and if you pick the wrong box you lose. The correct box is randomly selected with a number generator. My javascript code is working, but I am wondering if there might be a more efficient way to write it? Here is what I have now:
function rand(){
temp = Math.floor((Math.random()*6)+1);
document.getElementById("one").onclick = one;
document.getElementById("two").onclick = two;
document.getElementById("three").onclick = three;
document.getElementById("four").onclick = four;
document.getElementById("five").onclick = five;
document.getElementById("six").onclick = six;
}
function correct(){
alert("You are correct");
}
function incorrect(){
alert("You are incorrect");
}
function one(){
if (temp == 1){
correct();
}
else {
incorrect();
}
}
function two(){
if (temp == 2){
correct();
}
else {
incorrect();
}
}
function three(){
if (temp == 3){
correct();
}
else {
incorrect();
}
}
The code goes on like this for all six boxes. I've been thinking for hours how I could do this with a loop or something, but I just can't figure it out. Any help would be much appreciated.