-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodewarsChallenge50.html
More file actions
65 lines (63 loc) · 1.8 KB
/
codewarsChallenge50.html
File metadata and controls
65 lines (63 loc) · 1.8 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
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Event Handling Example</title>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
margin-left: 15px;
font-family: Arial, sans-serif;
background-color: #f0f0f0;
}
h1 {
margin-bottom: 20px;
}
p {
margin-bottom: 20px;
}
.button-container {
display: flex;
justify-content: space-between;
width: 100%;
padding: 0 20px;
}
button {
padding: 10px 20px;
font-size: 16px;
color: white;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #0056b3;
}
a {
text-decoration: none;
color: white;
}
</style>
</head>
<body>
<h1>Event Handling Example</h1>
<p>Click the button to see the alert</p>
<div class="button-container">
<button id="myButton">Click me</button>
<button><a href="index.html">Go back to the main page</a></button>
</div>
<script>
const button = document.getElementById('myButton');
button.addEventListener('click', () =>
alert('Button was clicked!'));
</script>
</body>
</html>