Skip to content

Commit 9b7f030

Browse files
committed
Add Event.html and Functions.js for basic arithmetic operations
1 parent b477f7d commit 9b7f030

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Example/Lectures/03 Day/Event.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Document</title>
7+
<script src="Functions.js"></script>
8+
</head>
9+
<body>
10+
<button onclick="info()">Click</button>
11+
12+
<input type="text" id="num1">
13+
<input type="text" id="num2">
14+
15+
<button onclick="add()">Print Add</button>
16+
17+
<h1>Result <span id="print_result"></span></h1>
18+
19+
</body>
20+
</html>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
function info(){
2+
// function body
3+
alert("welcome to codeswithpankaj")
4+
}
5+
6+
function add(){
7+
8+
num1 = document.getElementById("num1").value;
9+
num2 = document.getElementById("num2").value;
10+
11+
num1 = parseInt(num1);
12+
num2 = parseInt(num2);
13+
14+
result = num1 + num2;
15+
16+
document.getElementById("print_result").innerHTML = result;
17+
18+
19+
}

0 commit comments

Comments
 (0)