I am trying to swap the contents inside a button that toggles the crash navigation.
I currently have the following code:
<button class="navbar-toggle collapse in" data-toggle="collapse" id="menu-toggle-2"> <i class="fa fa-expand" aria-hidden="true"></i> Expand</button> //in js script $("#menu-toggle-2").click(function(e) { e.preventDefault(); $("#page").toggleClass("toggled-2"); });
I want to be able to change the contents inside,
<i class="fa fa-compress" aria-hidden="true"></i> Collapse
This needs to be switched, however, when you click the "Collapse" button, it returns to its original state
Doesn't seem to figure this out ...
source share