Created
September 24, 2021 05:51
-
-
Save wpgaurav/438e446c585e03d5fd5adb8f8f452779 to your computer and use it in GitHub Desktop.
Load CSS on Button Click - Useful for DarkMode config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link id="custom_stylesheet" rel="stylesheet" type="text/css" href="" /> | |
<script> | |
function LoadStyleAndScript() | |
{ | |
$("#custom_stylesheet").attr("href", "//example.com/mystyle.css"); | |
} | |
</script> | |
<input type="button" onClick="LoadStyleAndScript();" value="Load it"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment