How to change color of font-awesome icon by clicking the icon
问题 var garbage = document.getElementById("garbage"); garbage.addEventListener("click",function(){ garbage.style.color = "#66c144"; } <link href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" rel="stylesheet"> <div id="garbage"> <i class="fas fa-trash"></i> </div> Hi, I am trying to change the font color for font-awesome trash icon by clicking the icon. However, it is not working. I would appreciate any tips on how to get this work. var trash = document.getElementById("trash"), glass