previous

page 13

next

This is the output from our code so far.
Each refresh should give a different layout.
Our next task is to add the row and column counters.

the row counters
function squares() {
var s1="<img src='images/0.png' class='square' id='";
var id=0;
var s2="' onClick='square_clicked(this);' a='7' v='0'>";
var n=0;
var s3="<div class='count right' id='n";
var s4="'>0</div>";
for (var r=0;r<10;r++) {
document.write("<div class='row'>");
for (var c=0;c<10;c++) {
document.write(s1+id+s2);
id++;
}
document.write(s3+n+s4);
n++;
document.write('</div>');
}
}
previous
next