0
I have the following line:
<li id="fecharMenu">
<i class="mdi mdi-window-close mdi-24px" id="iconFecharMenu"></i>
<a href="#"></a>
</li>
When the user clicks on <li id="fecharMenu">
, the menu closes and I would like you to change the icon and consequently, the id of the <li>
of <i>
, being like this:
<li id="abrirMenu">
<i class="mdi mdi-menu mdi-24px" id="iconAbrirMenu"></i>
<a href="#"></a>
</li>
Javascript that I currently have, it "closes" the menu only, I would like to change the icon and id of li and icon too, so you can create an event by clicking the menu open button:
document.getElementById("fecharMenu").addEventListener("click", fecharMenu);
function fecharMenu() {
document.getElementById("barraLateral").style.width = "60px";
}
How could I do only with Javascript, without using Jquery?
where is the icon?
– mercador
Is the
<i class="mdi mdi-menu mdi-24px" id="iconAbrirMenu"></i>
. It is icone of Material Design Icons.– D. Watson