-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelement.html
More file actions
64 lines (61 loc) · 1.98 KB
/
Copy pathelement.html
File metadata and controls
64 lines (61 loc) · 1.98 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
<!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>
*{
margin: 0;
padding: 0%;
box-sizing: border-box;
}
#element-placer{
position: absolute;
display: flex;
flex-direction: column;
border: 1px solid black;
padding: 20px;
align-items: center;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.input-bar{
position: relative;
margin-bottom: 20px;
height: 30px;
width: 300px;
border-radius: 5px;
padding: 20px;
outline: none;
cursor: pointer;
}
input[type='submit']{
align-items: center;
padding-bottom: 12%;
}
</style>
</head>
<body>
<div id="element-placer"></div>
<script>
const parentContainer = document.getElementById("element-placer");
const newElement = document.createElement("input");
newElement.setAttribute("type","text");
newElement.classList.add("input-bar");
newElement.setAttribute("placeholder","Enter your username");
const anotherEle = document.createElement("input");
anotherEle.classList.add("input-bar");
anotherEle.setAttribute("type","password");
anotherEle.setAttribute("placeholder","Enter your password");
const buttonEle = document.createElement("input");
buttonEle.classList.add("input-bar");
buttonEle.setAttribute("type","submit");
buttonEle.setAttribute("value","Submit");
parentContainer.appendChild(newElement);
parentContainer.appendChild(anotherEle);
parentContainer.appendChild(buttonEle);
</script>
</body>
</html>