-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday_27_jsposition.html
More file actions
35 lines (35 loc) · 1.05 KB
/
Copy pathday_27_jsposition.html
File metadata and controls
35 lines (35 loc) · 1.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div class="" style="position: relative">
<button id="btnsave" onclick="clickme();" style="position: relative">
save
</button>
<div id="divShow" style="display: none">
manishaaa sinfgg <br />
shilpa <br />
anjali <br />
nfjsdgn<br />
k kefw<br />
</div>
</div>
<script>
function clickme() {
var btnsave = document.getElementById("btnsave");
var divShow = document.getElementById("divShow");
var rect = btnsave.getBoundingClientRect();
divShow.style.display = "block";
divShow.style.position = "absolute";
divShow.style.top = `${rect.bottom + window.scrollY + 10}px`;
divShow.style.left = `${rect.left + window.scrollX + 10}px`;
// Show the div
divShow.style.display = "block";
}
</script>
</body>
</html>