Web Technology Slip 2
technical_saurabh
December 20, 2020
Q1. Write a java script program to accept a number form user and display its multiplication table
Answer:
<html>
<head>
<script>
function multi1()
{
var num , i, multi;
num = Number(document.getElementById("a").value);
multi = document.getElementById('pPrint');
for(i=1; i<=10; i++)
{
multi.innerHTML += (num*i) + "<br/>"
}
}
</script>
</head>
<body>
<form>
<fieldset>
<legend>JavaScript Program</legend>
<table border="3" bgcolor="black" style="color: aliceblue;">
<tr>
<td style="padding:20 20 20 20">
<p>Q. Write a java script program to accept a number form user and display its multiplication table </p>
<p><strong>Multiplication Table</strong></p>
Insert Value : <input type="text" id="a">
<input type="button" value="Click" onclick="multi1()">
<button type="reset" value="Reset">Reset</button>
<p id="pPrint"></p>
</td>
</tr>
</table>
</form>
</fieldset>
</body>
</html>
Web Technology Slip 2
Reviewed by technical_saurabh
on
December 20, 2020
Rating:
Reviewed by technical_saurabh
on
December 20, 2020
Rating: