for example i have 12 div tags that each represent a month. when clicked each one will display another div for its month and hide all the other months divs
The 12 month divs have the class month
in common. the sections that each contain content for that month have month_section
in common and the name of the month they represent as uncommon.
my javascript code so far:
$("#January,#February,#March,#April").click(function(e)){
$(".month").removeClass("highlight");
$(".month_sections").removeClass("show");
$(".month_sections").addClass("hide");
if(this == "#January"){(this).addClass("highlight");$(".january").addClass("show");}
else if(this == "#February"){(this).addClass("highlight");$(".february").addClass("show");}
else if(this == "#March"){(this).addClass("highlight");$(".march").addClass("show");}
else if(this == "#April"){(this).addClass("highlight");$(".april").addClass("show");}
});
the if statement is not being correctly detected