forked from 0xtaufeeq/Git-and-Github-RVU
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyedmwasiq.html
More file actions
25 lines (24 loc) · 778 Bytes
/
Copy pathsyedmwasiq.html
File metadata and controls
25 lines (24 loc) · 778 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
<!DOCTYPE html>
<html>
<head>
<title>Adding</title>
</head>
<body>
<script>
function addNumbers() {
var num1 = parseInt(document.getElementById("num1").value);
var num2 = parseInt(document.getElementById("num2").value);
var result = num1 + num2;
document.getElementById("output").innerHTML = result;
}
</script>
<h3>Add two numbers</h3>
<label for="num1">Enter the first number:</label>
<input type="number" id="num1"><br><br>
<label for="num2">Enter the second number:</label>
<input type="number" id="num2"><br><br>
<button onclick="addNumbers()">Add</button>
<br><br>
<p>The sum is: <span id="output"></span></p>
</body>
</html>