-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
41 lines (41 loc) · 1001 Bytes
/
main.js
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
document.title = "project-js-7";
let input = document.getElementById("input");
let button = document.getElementById("button");
let parent = document.getElementById("shape");
window.onload = function () {
input.focus();
}
input.onblur = function () {
button.focus();
}
input.style.cssText = `
padding: 0.8em;
border-radius: 3px;
`;
button.style.cssText = `
background-color: #590C69;
color: white;
padding: 0.8em 1.5em;
border-radius: 3px;
border: none;
cursor: pointer;
`;
parent.style.cssText = `
background-color: white;
padding: 2em;
border-radius: 30px;
min-height: 20em;
min-width: fit-content;
max-width: 20em;
text-align: center;
`;
button.onclick = function (params) {
let text = document.createElement("div");
text.innerHTML = `<span>${input.value}</span>`;
text.style.cssText = `
margin: 10px;
border-top: 1px solid #eee;
padding: 10px;
`;
parent.appendChild(text);
}