The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Dark/Light color switch Reply To: Dark/Light color switch


I tried to post a reply but apparently edited too many times. My keyboard when haywire, outputting the wrong characters…

Anyway, the second part of your existing code could be reduced to this:

$('#theme').toggleClass('light dark');

I’ll have to take another look at what you’re trying the do exactly otherwise.