I'm not sure why but for some reason the class is getting added but is not activating. What could be the reason?
let phone = document.querySelector("#phoneIcon")
phone.addEventListener("click", function() {
phone.classList.add("phoneIconClick")
phone.parentNode.removeChild(phone)
})
#aside {
clear: both;
float: right;
margin: 5%;
}
#phoneIcon {
font-size: 30px;
border: solid;
padding: 5px;
border-radius: 50%;
position: fixed;
}
.phoneIconClick {
font-size: 15px;
border: solid;
padding: 10px 0px 10px 300px;
border-radius: 10%;
}
<aside id="aside">
<span id="phoneIcon"><i class="fas fa-phone"></i></span>
</aside>