I am trying to add in a very simple method of switching between 2 stylesheets.
I can get the stylesheet to fire on click but not able to toggle it back to its origin
There is the requested simple example:
HTML:
<link rel="stylesheet" type="text/css" id='styles' href='path_to_your_style_1'>
<button id="css_toggle" title="I'm a tooltip!">Text</button>
JS:
$('#css_toggle').click(function () {
if ($("link[id='styles']").attr('href') == 'path_to_your_style_1'){
$("link[id='styles']").attr('href', 'path_to_your_style_2');
} else {
$("link[id='styles']").attr('href', 'path_to_your_style_1');
}
});