I got this HTML code:
Transform "default".css into "default.css". Do the same for dark.css.
Then onclick takes a function as a value.
style1.onclick = function () { swapStyleSheet("default.css") }; style2.onclick = function () { swapStyleSheet("dark.css") };