-
Notifications
You must be signed in to change notification settings - Fork 0
/
js_htm.html
104 lines (101 loc) · 3.24 KB
/
js_htm.html
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
height: 100vh;
align-items: center;
}
.container{
background-color: rgb(44, 40, 40);
width: 250px;
border: 2px solid;
height: 100%;
border-radius: 20px;
}
#FirstName{
margin: 10px;
height: 30px;
background-color: burlywood;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
#Last_name{
margin: 10px;
height: 30px;
background-color: burlywood;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
#overall{
background-color: red;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
width: 200px;
border-radius: 15px;
/* height: 25px; */
}
#call{
background-color: greenyellow;
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
width: 200px;
border-radius: 15px;
font-weight: 800;
}
button{
height: 30px;
width: 75px;
border-radius:20px;
background-color: red;
font-weight: 800;
border: 0px;
}
button:hover{
background-color: rgb(17, 219, 17);
transition: 0.7s;
cursor: pointer;
}
h1{
transform: rotate(45deg);
transform: scale(2);
transform: translate(1);
animation:play 5s infinite;
}
@keyframes play {
from(background-color: red;)
to(background-color: green;)
}
</style>
</head>
<body>
<center>
<div class="container">
<input type="text" placeholder="Enter name" id="FirstName"><br>
<input type="text" placeholder="Enter Last name" id="Last_name"><br>
<button onclick="name_call()">Click</button><br>
<b><p id="overall"></p></b>
<b><p id="call"></p></b>
</div>
</center>
<h1>Header</h1>
<script>
function name_call(){
let name = document.getElementById('FirstName').value;
let lowcase=name.toLowerCase();
let lname = document.getElementById('Last_name').value;
let fullname = name + " " + lname;
if(lowcase==='manzil'){
document.getElementById('overall').innerText="Invalid input"
}else if(lowcase==='' || lname ===''){
document.getElementById('overall').innerText="Please enter something before clicking click button!!!"
}else{
document.getElementById('call').innerText = 'CHAKKA!!! ' + fullname;
}
}
</script>
</body>
</html>