Is there a way to change the background-color of the entire site and specific modal elements when a user switches between two radio buttons?
Here is the HTML code for the radio buttons:
<div class="btn-group btn-group-xs" data-toggle="buttons">
<label class="btn btn-default lightBtn">
<input type="radio" name="options" id="light"> Light
</label>
<label class="btn btn-default darkBtn">
<input type="radio" name="options" id="dark"> Dark
</label>
</div>
I have tried using jQuery to change the background-color based on the radio button selection, but it hasn't been successful so far.
$( function() {
$('#lightBtn').click( function() {
$('body').css('background', 'white' );
});
$('#darkBtn').click( function() {
$('body').css('background', 'black' );
});
});
Additionally, the radio button selection resets when navigating between pages. Is there a way to maintain the selected option using jQuery across pages?