Change icon on clicking using "toggle"

I have the same HTML, CSS and Javascript as here: How to close this menu after click
Please let me know how to change the hamburger icon to a close (x) icon (without using rotation of the icon) after clicking and opening the topnav Nav bar. I tried what is posted here and failed (I did add and try out all that was mentioned there, including the <i id="click-spanish" class="fa fa-caret-down"></i> and <div id="spanish-examples"></div>): Change toggle icon on click

9 thoughts on “Change icon on clicking using "toggle"”

Leave a Comment