I am trying to change the border color for one of the elements to red.
var monDaynum = 30;
var nowDay = 3;
var el = document.getElementById('calendar');
for(var i = 1; i <= monDaynum; i++) {
var subContent = document.createElement("div");
subContent.className = "canChoose";
if(nowDay === i){
subContent.style.borderBottomColor = "red" // doesn't work
} else {
}
if(i == nowDay){
subContent.classList.add("today");
}
subContent.innerHTML = i;
el.appendChild(subContent);
}
.canChoose {
width: 50px;
display: inline-block;
padding: 5px;
text-align: center;
}
.calendar-content .canChoose:after {
width: 20px;
margin-top: 5px;
margin-left: auto;
margin-right: auto;
border-bottom: 8px solid #5A8C19; /*Change the color here*/
border-radius: 10px;
content: "";
display: block;
}
<div id="calendar" class="calendar-content">
</div>
I tried to change with JavaScript code, but failed