From cbfbedcaceccda890a7f15cb806561ede72e8044 Mon Sep 17 00:00:00 2001 From: piernov Date: Mon, 2 May 2016 20:14:17 +0200 Subject: Allow multiple classes on tabs --- js/gui.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/gui.js b/js/gui.js index bdf1710..89fa0fa 100644 --- a/js/gui.js +++ b/js/gui.js @@ -6,10 +6,8 @@ function changeTab() { var id = window.location.hash.substr(4); var tabs = document.querySelectorAll("#tabs-panel > ul > li"); for(var i=0; i < tabs.length; i++) { - if(i == id-1) - tabs[i].className = "active"; - else - tabs[i].className = ""; + if(i == id-1) tabs[i].classList.add("active"); // Doesn't work with IE < 10 (and Opera Mini), but who cares? + else tabs[i].classList.remove("active"); } } -- cgit v1.2.3-70-g09d2