我只想申请一个课程3秒钟,为什么不删除该课程。
var x = 0;
var notes = ['a','b','c'];
while (x < notes.length) {
document.getElementById(notes[x]).classList.add('active');
x++;
}
function RemoveClass() {
var x = 0;
while (x < notes.length) {
document.getElementById(notes[x]).classList.remove("active");
x++;
}
}
window.setTimeout(RemoveClass, 3000);
.active{color:blue}
<div id="a">First</div>
<div id="b">Second</div>
<div id="c">Third</div>