function oldseason(evt) { $(".new").css("display", "none"); $(".rest").css("display", "none"); $(".old").css("display", "block"); //works $("#buttonold").attr("class", 'buttoninactiveint'); $("#buttonnew").attr("class", 'buttonactiveint'); $("#buttonall").attr("class", 'buttonactiveint'); //also works // $("svg:first").find("#buttonold").attr("class", "buttoninactiveint"); // $("svg:first").find("#buttonnew").attr("class", "buttonactiveint"); // $("svg:first").find("#buttonall").attr("class", "buttonactiveint"); // next doesn't // document.getElementById("buttonold").className = "buttoninactiveint"; // document.getElementById("buttonnew").className = "buttonactiveint"; // document.getElementById("buttonall").className = "buttonactiveint"; //this should work but doesn't // $("#buttonold").removeClass('buttonactive').addClass('buttoninactive'); // $("#buttonnew").removeClass('buttoninactive').addClass('buttonactive'); // $("#buttonall").removeClass('buttoninactive').addClass('buttonactive'); // //this awful shit works, leaving class as it is, and change the properties // not nice... // $("#buttonold").css("stroke", "yellow").css("fill", "white"); // $("#buttonnew").css("stroke", "white").css("fill", "yellow"); // $("#buttonall").css("stroke", "white").css("fill", "yellow"); // $("#g_buttonold").css("cursor", "default"); // $("#g_buttonnew").css("cursor", "pointer"); // $("#g_buttonall").css("cursor", "pointer"); } function newseason(evt) { $(".old").css("display", "none"); $(".rest").css("display", "none"); $(".new").css("display", "block"); $("#buttonold").attr("class", 'buttonactiveint'); $("#buttonnew").attr("class", 'buttoninactiveint'); $("#buttonall").attr("class", 'buttonactiveint'); } function allteams(evt) { $(".new").css("display", "block"); $(".old").css("display", "block"); $(".rest").css("display", "block"); $("#buttonold").attr("class", 'buttonactiveint'); $("#buttonnew").attr("class", 'buttonactiveint'); $("#buttonall").attr("class", 'buttoninactiveint'); }