-
Notifications
You must be signed in to change notification settings - Fork 0
/
index-8.html
34 lines (31 loc) · 912 Bytes
/
index-8.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
<!DOCTYPE html>
<html>
<head>
<title>The JQuery Example</title>
<script type="text/javascript" src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js">
</script>
<script type = "text/javascript" language = "javascript">
$(document).ready(function() {
$("li").eq(2).addClass("selected");
$("li").eq(3).addClass("highlighted");
//$("li").eq(2).removeClass("highlighted");
});
</script>
<style>
.selected { color:red; }
.highlighted{ color: yellow;}
</style>
</head>
<body>
<div>
<ul>
<li>list item 1</li>
<li>list item 2</li>
<li>list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
<li>list item 6</li>
</ul>
</div>
</body>
</html>