-
Notifications
You must be signed in to change notification settings - Fork 0
/
4 - events.html
45 lines (36 loc) · 1.08 KB
/
4 - events.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" type="text/css" media="screen" href="main.css" /> -->
<!-- <script src="main.js"></script> -->
<script src="js/jquery-3.3.1.min.js"></script>
<script>
$("document").ready(function () {
$("#textBox").on("click", whenMouseIsClicked);
$("#textBox").on("mouseleave", whenMouseLeaves);
function whenMouseIsClicked() {
$("#textBox").html("<h1>You click me!</h1>");
}
function whenMouseLeaves() {
$("#textBox").html("<h1>Where are you going?</h1>");
}
});
</script>
<style>
#textBox {
width: 250px;
height: 250px;
border: 1px solid black;
background-color: aliceblue;
}
</style>
</head>
<body>
<div id="textBox">
</div>
</body>
</html>