I am a beginner when it comes to CSS and jQuery. My goal is to color in an icon, similar to Instagram's heart icon which turns red when double-tapped.
Currently, I am using Font Awesome for this purpose. However, I am struggling to fill the color as desired. Changing the background-color property has not yielded the results I want.
Essentially, I would like the heart icon to change to a red color when a user clicks on it. Can anyone provide guidance on how to achieve this?
My HTML file
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="all.js"></script>
</head>
<body>
<div id="sp"><i class="far fa-heart" id="heart" style="color: green; background-color: red" ></i> </div>
</body>
</html>
The "all.js" file contains the icons that I downloaded.
If Font Awesome doesn't work out, are there any alternatives you can recommend?