-
-
Save melanyss/b69b9f3827dcb66904af73e6f36a8c5d to your computer and use it in GitHub Desktop.
Create a Like and Dislike Button using html,css and js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Like and Dislike</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css"> | |
<style> | |
.fa{ | |
font-size: 300px; | |
color: white; | |
cursor: pointer; | |
width: 400px; | |
height: 400px; | |
background-color: cornflowerblue; | |
border-radius: 100%; | |
line-height: 400px; | |
text-align: center; | |
} | |
.fa:hover{ | |
color: khaki; | |
} | |
</style> | |
</head> | |
<body> | |
<i onclick="myfunction(this)" class="fa fa-thumbs-up"><a type="text" id="show"></a></i> | |
<script> | |
function myfunction(x) | |
{ | |
x.classList.toggle("fa-thumbs-down"); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, Can you add a number count for like and dislike?