I need help adding a class to these links:
<a class="campusIcon km-icon" onclick ="window.location.href='indexHome.html'" data-rel="external">Campus</a>
<a class="searchIcon km-icon" onclick ="window.location.href='indexListView.html'" data-rel="external">Search</a>
<a class="mapIcon km-icon" onclick ="window.location.href='indexKBlock.html'" data-rel="external">Map</a>
<a class="favIcon km-icon" onclick ="window.location.href='indexChart.html'" data-rel="external">Fav</a>
The class I want to add is km-state-active
. If I add the class inside an onClick
event then I get my class is added but location.href
does not work.
So, what's the problem and how can I solve it?