<div id="progress" class="progress-bar "></div>怎么写一个方,判断是否存在class progress-100,没有就添加,有就删除,
<div id="progress" class="progress-bar "></div>
let dom = document.querySelector('#progress'); // 或者 let dom = document.getElementById('progress'); dom.classList.toggle('progress-100');
2.1m questions
2.1m answers
60 comments
57.0k users