147
rated 0 times
[
153]
[
6]
/ answers: 1 / hits: 96847
/ 10 Years ago, wed, february 26, 2014, 12:00:00
I am trying to create a simple times table in a html document using Javascript. This is my code so far:
<!DOCTYPE>
<html>
<head>
<title>Table</title>
</head>
<body>
<script language=javascript type=text/javascript>
for (var a=0; a < 10; a++) {
document.write(<tr>);
for(var b=0; b<10; b++) {
document.write(<td>a*b</td>);
}
document.write(</tr>);
}
</script>
</body>
</html>
I looked through the posted questions, but could not find an answer, possibly because I am a beginner programmer and did not understand most of it.
More From » for-loop