How can I reference a specific folder/file in my HTML code so that it encompasses the CSS, JavaScript, and HTML files?
Here's an example of the code I am working with:
<input onclick="setTimeout(function(){location.href='Darkmode';}, 500);" type="checkbox"/>
<label></label>
Within my directory, I have a folder named Darkmode
which contains files such as darkmode.html
, css
, and js
.
I intend to use this folder as a subsite for my main website. When a user toggles the button on my main site, I want them to switch to Dark Mode.
The issue lies in how to properly reference all the Darkmode
files simultaneously - including the HTML, CSS, and JS.
If I modify location.href='Darkmode';
to location.href='darkmode.html';
, solely the HTML is targeted without incorporating the associated CSS and JavaScript. Is there a method to link to these various files collectively, such that the browser processes the CSS, JS, and HTML components of Dark Mode?