-
Notifications
You must be signed in to change notification settings - Fork 0
/
10.html
37 lines (29 loc) · 860 Bytes
/
10.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
<!-- 10 Cancel the default action (click) of the first URL. Go to the editor
Sample Data :
<div style="background-color:yellow">
<p>Click the button to change the background color of this paragraph.</p>
<button>Click me!</button>
</div> -->
<!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>
<div>
<p>Default action is prevented </p>
<a href="https://www.google.com">Google</a>
</div>
</body>
<script>
$(document).ready(function () {
$('a').click(function (e) {
e.preventDefault();
});
});
</script>
</html>