-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path65.alink-tag-event.html
53 lines (52 loc) · 1.64 KB
/
65.alink-tag-event.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
53
<!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>Document</title>
<style>
.rect {
position: relative;
width: 800px;
height: 600px;
background-color: rgb(248, 232, 232);
border: 1px solid black;
}
.ball {
position: absolute;
width: 50px;
height: 50px;
border-radius: 50%;
background-color: rgb(245, 52, 52);
color: white;
font-weight: 800;
line-height: 50px;
text-align: center;
border: 1px solid black;
}
</style>
</head>
<body>
<a
href="https://tw.yahoo.com"
onclick="console.log(event);event.preventDefault();"
>ABC</a
>
<br />
<a href="https://www.pchome.com.tw" onclick="return false;">DEF</a>
<br />
<a href="https://www.pchome.com.tw"
onclick="return confirm('是否要去買東西?');"
>buy</a
>
<br />
<div class="rect" onclick="console.log('a')">
<div class="ball"><span>17</span></div>
</div>
<script>
const rect = document.querySelector(".rect");
const ball = document.querySelector(".ball");
</script>
</body>
</html>