-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
32 lines (24 loc) · 825 Bytes
/
index.html
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
<head>
<script>
function calculateResult (form) {
var lengthvar = form.length.value;
var breadthvar = form.breadth.value;
// alert (lengthvar * breadthvar);
document.getElementById("finalResult").innerHTML = "Answer : " + lengthvar * breadthvar;
}
function cancelResult (form) {
document.getElementById("finalResult").innerHTML ="";
}
</script>
</head>
<body>
<form>
<label for="length">Length:</label><br>
<input type="number" id="length" name="length" value="1"><br>
<label for="breadth">Breadth:</label><br>
<input type="number" id="breadth" name="breadth" value="1">
<input type="button" name="finalResult" value="Calculate" onClick="calculateResult(this.form)">
<input type="button" name="Cancel" value="Cancel" onClick="cancelResult(this.form)">
</form>
<p id="finalResult"></p>
</body></html>