-
Notifications
You must be signed in to change notification settings - Fork 0
/
14.html
39 lines (31 loc) · 854 Bytes
/
14.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
<!-- 14 Display the event type on clicking all h1 elements. Go to the editor
Sample Data :
<body>
<h1>This is header1</h1>
<h1>This is another header1</h1>
<h2>This is header2</h2>
<h2>This is header3</h2>
</body> -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<h1>This is header1</h1>
<h1>This is another header1</h1>
<h2>This is header2</h2>
<h2>This is header3</h2>
</body>
<script>
$(document).ready(function () {
$("h1").click(function (event) {
console.log(event.type);
});
});
</script>
</html>