-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainfriendlist.html
More file actions
34 lines (31 loc) · 924 Bytes
/
mainfriendlist.html
File metadata and controls
34 lines (31 loc) · 924 Bytes
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
<hmtl>
<head>
<title>Main Friend List</title>
<style>
span { cursor: pointer; }
</style>
</head>
<body>
<a href="home.html"><h1>Recommender System</h1></a>
<h1>Friend List</h1>
<ol>
<li>Friend #1,sent Warriors at 11:00 am <span>☆</span></li>
<li>Friend #2,sent Percy Jackson at 9:00 am <span>☆</span></li>
</ol>
<a href="friendlist.html"><button>Add Friend</button></a>
<script>
var allStars = document.getElementsByTagName('span');
for (var i = 0; i < allStars.length; i++) {
var el = allStars[i];
el.addEventListener('click', function (e) {
var t = e.target;
if (t.innerText == "☆") {
t.innerText = "★";
} else {
t.innerText = "☆";
}
});
}
</script>
</body>
</html>