Is there any reason why the click doesn't work in IE6 on the following JQuery code? See ...$('#toggleVAT').click(function... It works in IE7 and FF?
function switchButton(to){
if(to === 'INC'){
$('#toggleVAT').removeClass("exc");
$('#toggleVAT').addClass("inc");
$('#toggleVAT em').text("inc.");
} else {
$('#toggleVAT').addClass("exc");
$('#toggleVAT').removeClass("inc");
$('#toggleVAT em').text("exc.");
}
}
function switchPrices(){
if($.cookie('VATMODE') == "INC"){
$('.price .incVAT').show();
$('.price .excVAT').hide();
switchButton('INC');
} else {
$('.price .incVAT').hide();
$('.price .excVAT').show();
switchButton('EX');
}
}
$(function(){
switchPrices();
$('#toggleVAT').click(function(){
if($.cookie('VATMODE') === 'INC'){
$.cookie('VATMODE', 'EX');
switchButton('EX');
} else {
$.cookie('VATMODE', 'INC');
switchButton('INC');
}
switchPrices();
return false;
});
});
On IE6 switchPrices() runs once, but it does not execute the code when I click #toggleVAT. I am using latest minified jQuery. #toggleVAT is just a paragraph. I am using IETester http://my-debugbar.com/wiki/IETester/HomePage. I checked it on natively running IE6 before and the bahaviour was the same. I've also rulled out possible CSS issues as the problem persists without stylesheet.