There is possible update the css href with js page loaded

There is possible update the css href with js page loaded
0

#1

I mean something like:

On window on load

.attr(‘href’, ‘newcsspath.css’);

?


#2

No.

But you can define multiple different styles in the same css and render them conditionally using js. You should take react curriculum here in FCC.


#3

Yeah, basically that, I think you also need to force the page to reload, it’s been a while since I’ve needed to do it, have a Google around to checl. It’s just a few lines of basic JS anyway though - find the stylesheet tag (use getElementByTagName or whatever then check for a style attribute), replace the href, force reload.

What do you want to do it on load though?