-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment7.html
52 lines (49 loc) · 1.35 KB
/
experiment7.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Experiment-7</title>
<script>
function fn(){
var str = document.querySelector(".top").value;
var lastname = document.querySelector(".middle").value;
var email = document.querySelector(".bottom").value
document.getElementById("print").innerHTML = "First name: " +str + "," + "Last name: " + lastname + "," + "Email: "+email
}
</script>
<style>
body {
text-align: center;
}
.top {
width: 15vw;
height: 2rem;
background-color: #edffec;
border-color: gray;
border-width: 1px;
border-radius: 7px;
margin: 0.5em;
}
.btn {
width: 10vw;
height: 2rem;
margin-top: 20px;
background-color: #e4bad4;
border-radius: 10px;
}
</style>
</head>
<body>
<div>
<form action="">
<input type="text" class="top" placeholder="First name"><br>
<input type="text" class="top middle" placeholder="last name"><br>
<input type="email" class="top bottom" name="email" placeholder="[email protected]"><br>
<button type="button" onclick="fn()" class="btn" >Submit</button>
</form>
</div>
<h1 id ="print"></h1>
</body>
</html>