Skip to content

Commit ebb6fc3

Browse files
authored
Create toggle
1 parent 4923c8f commit ebb6fc3

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

‎toggle‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
5+
<style>
6+
.fa {
7+
font-size: 50px;
8+
cursor: pointer;
9+
user-select: none;
10+
}
11+
12+
.fa:hover {
13+
color: darkblue;
14+
}
15+
</style>
16+
</head>
17+
<body>
18+
19+
<p>Click on the icon to toggle between thumbs-up and thumbs-down (like/dislike):</p>
20+
21+
<i onclick="myFunction(this)" class="fa fa-thumbs-up"></i>
22+
23+
<script>
24+
function myFunction(x) {
25+
x.classList.toggle("fa-thumbs-down");
26+
}
27+
</script>
28+
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)