js function can be placed in a separate js file or within the
tag of the current page
function getCSS()
{
datetoday = new Date();
timenow=datetoday.getTime();
datetoday.setTime(timenow);
thehour = datetoday.getHours();
if (thehour<12)
display = "1.css";
else if (thehour>12)
else 🎜> display = "2.css";
'link rel="stylesheet" href=' display ' /';
css ='>';
document.write(css);
}
HTML file to which this style sheet is applied
Copy code
The code is as follows:
Display different prompt information at different times
js controls different time periods to display different css styles