- ARCHIVE / TAG ARCHIVE
- Javascript-Session 2-Multiplication Table 3
A multiplication table where the number of rows are randomly generated from a number between 10 and 20 by passing on the variable RandomNumRow; and columns from 1 to 5 by passing on the variable RandomNumCol. Here is the link, refresh to generate new numbers.
<html>
<body>
<script language=”JavaScript”>
document.write(’<table border=0>’);
//—creates random number for rows—
minimum = 10;
max = [...] - Javascript-Session 2-Multiplication Table 2
A multiplication table where the number of rows and columns are randomly generated from a number between 1 and 10 by passing on the variable RandomNum. Here is the link, refresh to generate a new number.
<html>
<body>
<script language=”JavaScript”>
document.write(’<table border=0>’);
minimum = 1;
max = 10;
numb = genRand(minimum, max); //call function, pass and receive data
function [...] - Javascript-Session 2-Multiplication Table 1
A multiplication table where the number of rows and columns are set by the variables: rowNum and colNum. A link to the table is here.
<html>
<body>
<script language=”JavaScript”>
document.write(’<table border=0>’);
var rowNum = 20
var colNum = 10
//—creates index(red) row ‘X’ through number set in “var colNum”—
document.write(’<tr style=color:red>’);
document.write(’<td>’+’X’+’</td>’);
for (row1=1; row1<=colNum; row1++)
{
document.write(’<td>’+row1+’</td>’);
}
document.write(’</tr>’);
//—
var col1=1
for (row=1; row<=rowNum; row++)
{
document.write(’<tr>’);
//—creates index(red) column, number of rows [...] - Javascript-Session 1-Variables
Multiplication where numbers to be multiplied, the result and output are determined by variables. Online here.
<html>
<head>
<title>Variable</title>
</head>
<body>
<h1>Multiply</h1>
<script language=”JavaScript”>
document.write(”<h2>var num and num2</h2>”);
var num = 4;
var num2 = 6;
var num3 = num * num2;
document.write(num + ” x “+ num2 + ” = ” + num3);
</script>
</body>