previous

page 9

next
index.html
<style>
.row {
display:flex;
align-items:center;
}
.cell {
height:13vmin;
border:thin solid;
}
</style>
<script src='one_row.js'></script>
<script src='cell_clicked.js'></script>
<div class='row'>
<script>one_row();</script>
</div>
one_row.js
function one_row() {
var s1=" <img src='counters/0.png' class='cell' id='";
var s2="' cn='0' onClick='cell_clicked(this);'>";
for (var i=0; i<5; i++) {
document.write(s1 + i + s2);
}
document.write('<div>0</div>');
}
cell_clicked.js
function cell_clicked(image) {
image.src='counters/1.png';
image.setAttribute('cn','1');
}
previous
next