-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPR1.HTML
More file actions
52 lines (46 loc) · 2.05 KB
/
Copy pathPR1.HTML
File metadata and controls
52 lines (46 loc) · 2.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-wEmeIV1mKuiNpC+IOBjI7aAzPcEZeedi5yW5f2yOq55WWLwNGmvvx4Um1vskeMj0" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css">
<link rel="shortcut icon" href="favicon.png" type="image/png">
<title>Practice session 1</title>
</head>
<body>
<div class="d-flex align-content-center flex-column m-5 p-5">
<h3>Problem 1 - Change Background Color by OnClick() - </h3>
<button class="btn btn-outline-dark m-3" onclick="red()">RED</button>
<button class="btn btn-outline-dark m-3" onclick="green()">GREEN</button>
<button class="btn btn-outline-dark m-3" onclick="blue()">BLUE</button>
<button class="btn btn-outline-dark m-3" onclick="yellow()">YELLOW</button>
<button class="btn btn-outline-dark m-3" onclick="black()">BLACK</button>
<script>
function red() {
document.body.style.backgroundColor = "red";
}
function green() {
document.body.style.backgroundColor = "green";
}
function blue() {
document.body.style.backgroundColor = "blue";
}
function yellow(){
document.body.style.backgroundColor = "yellow";
}
function black(){
document.body.style.backgroundColor = "black";
}
</script>
</div>
<div class="d-flex align-content-center flex-column m-5 p-5">
<h3>Problem 2 - </h3>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-p34f1UUtsS3wqzfto5wAAmdvj+osOnFyQFpp4Ua3gs/ZVWx6oOypYoCJhGGScy+8"
crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>
</html>