-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddition.html
More file actions
26 lines (24 loc) · 718 Bytes
/
addition.html
File metadata and controls
26 lines (24 loc) · 718 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Addition</title>
</head>
<body>
Enter the First number : <input id="first">
Enter the Second number: <input id="second">
<button onclick="add()">Add</button>
<input id="answer">
<script>
function add() {
var a, b, c;
a = Number(document.getElementById("first").value);
b = Number(document.getElementById("second").value);
c = a + b;
document.getElementById("answer").value = c;
}
</script>
</body>
</html>