How to Create a Like and Dislike Button Easy ?
SEO Help and Tips
How to Create a Like and Dislike Button Easy ?
Create a Like and Dislike Button with CSS and JavaScript:
Head:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
.fa {
font-size: 50px;
cursor: pointer;
user-select: none;
}
.fa:hover {
color: darkblue;
}
</style>
Body:
<p>like/dislike:</p>
<i onclick="myFunction(this)" class="fa fa-thumbs-up"></i>
<script>
function myFunction(x) {
x.classList.toggle("fa-thumbs-down");
}
</script>
Comments
Post a Comment
Thanks for your Comments.