-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_page.html
42 lines (39 loc) · 1.05 KB
/
test_page.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
<!DOCTYPE html>
<html>
<head>
<title>Dynamic Buttons and Pop-up</title>
<style>
#button2 {
display: none;
}
#popup {
display: none;
position: fixed;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
border: 1px solid #000;
background-color: white;
padding: 10px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.5);
}
</style>
</head>
<body>
<button id="button1" onclick="showButton()">Click Me</button>
<button id="button2" onclick="showPopup()">Button 2</button>
<div id="popup">This is a pop-up!</div>
<script>
function showButton() {
document.getElementById("button2").style.display = "block";
}
function showPopup() {
var popup = document.getElementById("popup");
popup.style.display = "block";
setTimeout(function() {
popup.style.display = "none";
}, 1000);
}
</script>
</body>
</html>