Skip to content Skip to sidebar Skip to footer

Can't Get If ... Else Statement To Properly Switch While Using Special Characters ("⏶/⏷")

In short I'm using special characters for a part of my website, and can't figure out how to express them in a JavaScript if ... else statement, which currently evaluates the if to

Solution 1:

Or you can do it with CSS class and not rely on the text

functionfuncAbout() {
    var btn = document.getElementById("undernavbtn");
    btn.classList.toggle("active")
}
#undernavbtnspan::after {
  content: " \25B2"; 
}

#undernavbtn.activespan::after {
  content: " \25BC"; 
}
<divid="undernav"><buttontype="button"id="undernavbtn"onclick="funcAbout()"><span>About</span></button></div>

Post a Comment for "Can't Get If ... Else Statement To Properly Switch While Using Special Characters ("⏶/⏷")"