-
Notifications
You must be signed in to change notification settings - Fork 0
/
MultiAndDivision.js
38 lines (34 loc) · 986 Bytes
/
MultiAndDivision.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//* Calculate Multipication and Division of two numbers from Users
fucntion mutiplyBy();
{
num1 = document.GetElementByID("firstnum").value;
num2 = document.GetElementByID("secondnum").value;
document.GetElementByID("result").innerHTML = num1 * num2;
}
function divideBy();
{
num1 = document.GetElementByID("firstnum").value;
num2 = document.GetElementByID("secondnum").value;
document.GetElementByID("result").innerHTMl = num1 / num2;
}
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JavaScript program to calculate multiplication and division of two numbers </title>
<style type="text/css">
body {margin: 30px;}
</style>
</head>
<body>
<form>
1st Number : <input type="text" id="firstnum" /><br>
2nd Number: <input type="text" id="secondnum" /><br>
<input type="button" onClick="multiplyBy()" Value="Multiply" />
<input type="button" onClick="divideBy()" Value="Divide" />
</form>
<p>The Result is : <br>
<span id = "result"></span>
</p>
</body>
</html>