-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddValue.html
More file actions
35 lines (27 loc) · 944 Bytes
/
Copy pathAddValue.html
File metadata and controls
35 lines (27 loc) · 944 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
27
28
29
30
31
32
33
34
35
<html>
<head>
<title>Add Values</title>
<h1>ADD VALUES</h1>
<script type="text/javascript">
function addValues()
{
alert("two text has been added together")
var a =document.getElementById("txt1").value
var b =document.getElementById("txt2").value
document.getElementById("op").innerHTML = "RESULT "+(a+b)
//from this code we will printing the output on the console
console.log(a+b)
}
</script>
</head>
<body>
<input type="text" name="" id="txt1" placeholder="enter your first text here">
<br>
<br>
<input type="text" name="" id="txt2" placeholder="enter youe second text here">
<br>
<br>
<button onclick="addValues()" >CLICK ME</button>
<h2 id="op">RESULT </h2>
</body>
</html>