-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJS-lect2.html
More file actions
88 lines (69 loc) · 2.01 KB
/
JS-lect2.html
File metadata and controls
88 lines (69 loc) · 2.01 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<style>
input[type="button"]
{
width: 50px;
border-radius: 5px;
height: 30px;
margin-top: 20px;
text-align: center;
color: red;
font-size: 15px;
outline: none;
border: 1px red dotted;;
}
input[type="text"]
{
height: 30px;
margin-top: 20px;
text-align: center;
color: red;
font-size: 20px;
outline: none;
border: 1px red dotted;;
}
input[type="text"]:focus
{
background-color: antiquewhite;
}
</style>
<script type="application/javascript">
function doJoin()
{
//var name=document.frm.txtName.value;//value is a variable of type string
//alert("Hello:"+name);
var fn=document.getElementById("txtFN").value;
var ln=document.getElementById("txtLN").value;
var full=fn+" "+ln;
document.getElementById("txtFull").value=full;
}
/*
function doSum()
{
var x="23.4";
var y="3.2";
var sum=x+y;//string+string
alert(sum);
var sumint=parseint(x)+parseint(y);
alert("Integers:"+sumint);
var sumfloat=parseFloat(x)+parseFloat(y);
alert("Floats:"+sumfloat);
}
*/
</script>
<center>
<body>
<form>
F.Name :<input type="text" id="txtFN" placeholder="fill ur name" autofocus ><br>
L.Name :<input type="text" id="txtLN" placeholder="fill ur last name" ><br>
<input type="button" value="Join" onclick="doJoin();">
<br>
Full Name :<input type="text" id="txtFull" ><br>
</form>
<hr>
<form>
<input type="button" value="Sum" onclick="doSum();">
</form>
</body>
</center>
</html>