Salazar
Salazar
  • 发布:2017-08-08 09:38
  • 更新:2017-08-08 21:14
  • 阅读:777

请问怎么通过JavaScript代码去更改伪元素的属性值?

分类:MUI
JS代码:  
for(var i = 1; i <= monDaynum; i++) {  
var subContent = document.createElement("div");  
subContent.className = "canChoose";  
if(nowDay === i) {  
subContent.style.borderBottomColor = "red";//It doesn't work  
} else {  
}  
if(i == nowDay) {  
subContent.classList.add("today");  
}  
subContent.innerHTML = i;   
el.appendChild(subContent);  
}  
CSS代码:  
.calendar-content .canChoose {  
color: #4A494A;  
font-size: 14px;  
font-weight: bold;  
border-bottom: 1px solid #BBBBBB;  
}  
.calendar-content .canChoose:after {  
width: 20px;  
margin-top: 5px;  
margin-left: auto;  
margin-right: auto;  
border-bottom: 8px solid #5A8C19;/*想要通过JS改变这里的颜色值*/  
border-radius: 10px;  
content: "";  
display: block;  
}
2017-08-08 09:38 负责人:无 分享
已邀请:
猫猫猫猫

猫猫猫猫 - 用户已离线

动态css覆盖

该问题目前已经被锁定, 无法添加新回复