~Set an array to a length predetermined to a variable, and have every element of the array equal the same thing
Arrays in Javascript don't have predefined lengths, you simply create elements as necessary:
Code:
var numels = 5, arr = [];
for(var i = 0; i < numels; ++i)
arr.push("Some value");
~Once that's done, record that the selected square takes up part of an element
What do you mean, "takes up part of an element?"
~Set each of the user's clicks to an array's element
Set a user's click? You can't modify a user's actions without some form of mind control over the user...
~When I calculate the random number, how to record that a selected square has been "clicked" so that it flashes and records it's value in the array
Give it a border, leave it there for a while, then remove it, using CSS and setTimeout(). I don't understand what this has to do with random numbers though.
Bookmarks