As a beginner in coding, I am attempting to design a page with 4 columns that will showcase different titles and descriptions each day of the week.
My goal is to have a set of titles and descriptions displayed on Monday, a different set on Tuesday, and so forth for each day of the week.
Despite spending nearly a week searching online, I have been unable to determine the code required to make this daily change happen.
While I have some idea of what script to use, I'm uncertain about the exact implementation.
var today = new Date();
if (today.getDay() == 1) document.getElementById("text").innerHTML = ;
else if (today.getDay() == 2) document.getElementById("text").innerHTML = ;
else if (today.getDay() == 3) document.getElementById("text").innerHTML = ;
else if (today.getDay() == 4) document.getElementById("text").innerHTML = ;
else if (today.getDay() == 5) document.getElementById("text").innerHTML = ;
else if (today.getDay() == 6) document.getElementById("text").innerHTML = ;
else if (today.getDay() == 0) document.getElementById("text").innerHTML = ;
* {
box-sizing: border-box;
}
body {
color: white
}
h2 {
color: white
}
.column {
float: left;
width: 15.00%;
padding: 10px;
margin: 1px;
}
.row:after {
content: "";
display: table;
clear: both;
}
<div class="row">
<div class="column" style="background-color:#333;">
<h2>Titel</h2>
<p> Description</p>
</div>
<div class="column" style="background-color:#333;">
<h2>Titel</h2>
<p> Description</p>
</div>
<div class="column" style="background-color:#333;">
<h2>Titel</h2>
<p> Description</p>
</div>
<div class="column" style="background-color:#333;">
<h2>Titel</h2>
<p> Description</p>
</div>
</div>
If anyone can provide assistance or point me in the right direction to resolve this issue, it would be greatly appreciated. Thank you!