<link id="target" href="css/custom.css" rel="stylesheet" />
HTML<button id="switch" class="btn btn-primary">Switch Stylesheet</button>
JavaScript<script>
var target = document.getElementById('target');
var href1 = target.href;
var href2 = target.href.replace('custom.css','custom-dark.css');
document.getElementById('switch').addEventListener('click', function() {
target.href = target.href == href1 ? href2 : href1;
});
</script>