-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhello.html
More file actions
53 lines (36 loc) · 1.01 KB
/
hello.html
File metadata and controls
53 lines (36 loc) · 1.01 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
<html>
<head>
<title>Hello JavaScript</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
$(document).ready(function() {
$('#hide').on("click", function() {
$('p').slideUp();
return false;
});
$('#show').on("click", function() {
$('p').slideDown();
return false;
});
$('#toggle').on("click", function() {
$('p').slideToggle();
return false;
});
$('#add').on("click", function() {
$('#add').parent().before('<p>Los Angeles</p>');
});
});
</script>
</head>
<body>
<h1>Cities</h1>
<p id="best">Chicago</p>
<p>Atlanta</p>
<p>New York</p>
<p>San Francisco</p>
<p><a id="add" href="#">Add Los Angeles</a></p>
<div><a id="hide" href="http://www.google.com">Click here to hide</a></div>
<div><a id="show" href="http://www.google.com">Click here to show</a></div>
<div><a id="toggle" href="http://www.google.com">Click here to toggle</a></div>
</body>
</html>