Multiplication Table Generator by using for loop
|
|
<html> <head> <title>Multiplication Table Generator</title>
<script language="javascript" type="text/javascript"> <!--
function generateTable() { var myVar = prompt("A number?", ""); var myString = ""; for (i=1; i<=6; i++) { myString += i+ " x " +myVar+ " = " +(i*myVar)+ "n"; } alert(myString); }
//--> </script>
</head> <body>
<a href="javascript:generateTable()">Create New Table</a>
</body> </html>
|
|
|
HTML code for linking to this page:
Related in same category :
-
-
-
-
-
-
-
|