I am trying to switch between a dark & light theme I have created on my MVC application.
My _Layout.cshtml page loads the default theme I have created below
<link id="theme" rel="stylesheet" href="~/lib/bootstrap/dist/css/Original.css">
I have created the below buttons to switch between the themes below
<button id="light">Light</button><br />
<button id="dark">Dark</button>
My two other bootstrap themes are located in lib > bootstrap> dist > css >
I have the below js in my botstrap.js file
$('#dark').click(function () {
$('link[href="~/lib/bootstrap/dist/css/Dark.css"]').attr('href', '~/lib/bootstrap/dist/css/Dark.css');
});
$('#light').click(function () {
$('link[href="~/lib/bootstrap/dist/css/Dark.css"]').attr('href', '~/lib/bootstrap/dist/css/Light.css');
});
Not sure if I am making some obvious error but any help on this is appreciated.