I'm working on a little project to learn more about Javascript so I can work on svg animations in the future.
Now I'm working on a button that will change his input when you click on it.
circle = document.getElementById('circle');
$remove = document.getElementById('remove');
remove.style.display = "block";
$undo = document.getElementById('undo');
undo.style.display = "none";
circle.onclick = function() {
remove.style.display = "none";
undo.style.display = "block";
}
.circle {
width: 200px; height: 200px;
background-color: #10ac84;
border-radius: 50%;
}
.circle svg { font-size: 1.5em; }
<div class="circle" id="circle">
<i class="fas fa-trash-alt" id="remove"></i>
<i class="fas fa-undo" id="undo"></i>
</div>
It's a little hard to put it in a snippet because I can't load the font awesome cdn.
-| What I'm trying to do |-
When you enter the page the circle will have an icon on a trashcan. When the user clicks the circle the trashcan will disappear and the undo icon will show up. This is for removing an item in my application and undo it when you want it back.
-| Question |-
Can I remove and add style to FontAwesome icons? Because it will transform into SVG's
I hope that I have explained it well and that someone can help me out.