3
I added a button on a website so that the user can leave it in "night mode". But if it goes to new news, the site will be deactivated at night mode.
It is possible to have the browser cache this information, so that once it leaves the mode in night mode, the other news that it accesses are also with this class?
var menu = document.querySelector('body.single-news');
var button = document.querySelector('button#skin-btn');
button.addEventListener('click', function() {
var open = menu.classList.contains('light-skin');
menu.classList.toggle('light-skin');
});
Removing the "light-skin" class activates night mode.
Curl is one of the most beautiful verbs we brought to English.
– Jéf Bueno