-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlike.html
31 lines (23 loc) · 914 Bytes
/
like.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
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"></link>
</head>
<body>
<i onclick="like()" class="glyphicon glyphicon-thumbs-up"><span id="likes"></i></span>
<i onclick="dislike()" class="glyphicon glyphicon-thumbs-down"><span id="dislikes"></i></span>
<script>
var likecount=0;
var dislikecount=0;
function like(){
likecount++;
console.log(likecount);
document.getElementById("likes").innerHTML=likecount;
}
function dislike(){
dislikecount++;
console.log(dislikecount);
document.getElementById("dislikes").innerHTML=dislikecount;
}
</script>
</body>
</html>