-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjQueryIntroduction.html
More file actions
67 lines (47 loc) · 1.46 KB
/
jQueryIntroduction.html
File metadata and controls
67 lines (47 loc) · 1.46 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
53
54
<!DOCTYPE html>
<html lang="en">
<head>
</script>
<meta charset="UTF-8">
<title>jQuery Exercise</title>
</head>
<body>
<div id="container">
<h1 id="welcome"></h1>
<div class="list-container">
<ul class="nav">
<li class="nav-item">Home</li>
<li class="nav-item">About Us</li>
<li class="nav-item">Contact</li>
<li class="nav-item">Careers</li>
<li class="nav-item">Apply</li>
</ul>
</div>
</div>
<footer>
<div class="footer-container">
<ul class="footer-nav">
<li class="footer-nav-item">Learn More</li>
<li class="footer-nav-item">Blog</li>
<li class="footer-nav-item">Email Us</li>
</ul>
</div>
</footer>
<!-- jQuery Introduction -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.js">
// Write the necesary code to wait for the DOM to load in jQuery
$(document).ready(function(){
// Select the footer element.
$("footer")
// Select the div with an id of container
$("#container")
// Select all of the li s iniside of the ul with a class of nav.
$(".nav li")
// Select the third li inside of the div with the clas of list-container.
$(".list-container li:nth-child(3)")
// Select only th last li in each of the ul s.
$("ul li:last-child ")
});
</script>
</body>
</html>