Each box is getting the assigned the same id only when I assign an onClick function to the boxes, if I remove the onClick then each box gets the correct corresponding id.