Currently, I am utilizing JavaScript to choose different CSS styles for various accessibility options such as black on white text and larger text. The issue I am facing arises when switching the CSS sheet, as elements from previously selected sheets are still being used. For a clearer understanding of this problem, you can visit the website here (please note that it may not display correctly in IE). By clicking on the different [Aa] options, you can alter the style. Below is the code snippet I am using (JavaScript):
if ($.cookie("css")) {
$("link").attr("href", $.cookie("css"));
}
$(document).ready(function() {
$("#accessibility a").click(function() {
$("link").attr("href", $(this).attr('rel'));
$.cookie("css", $(this).attr('rel'), {
expires: 365,
path: '/'
});
return false;
});
});
In addition, here is the HTML code:
<a href="#" rel="index.css"><img src="images/bonw.png"></a>
<a href="#" rel="index_wonb.css"><img src="images/wonb.png"></a>
<a href="#" rel="index_+.css"><img src="images/+.png"></a>
I'm seeking assistance in understanding why this issue is occurring and would greatly appreciate any help provided!