Bu cevap, konu sahibi tarafından kabul edilebilir bir cevap olarak işaretlendi.
<script>
var swapStyleSheet = function (sheet) {
document.getElementById('pagestyle').setAttribute('href', sheet);
storebackground(sheet);
}
var storebackground = function (swapstylesheet) {
localStorage.setItem("sheetKey", swapstylesheet); //you need to give a key and value
}
var loadbackground = function () {
let sheetKey = localStorage.getItem('sheetKey');
if (!sheetKey) {
sheetKey = 'https://bootswatch.com/5/sketchy/bootstrap.min.css'
}
document.getElementById('pagestyle').setAttribute('href', sheetKey);
}
window.onload = loadbackground();
</script>
Altta localStorage'dan çekmeye devam etmiş, onu gözden kaçırmışız hocam deneyin bu şekilde düzelir