<div class="none-box2-btn"> <div id="boxBtn1" class="none-box2-btn-son btnlight" onclick = "document.getElementById('boxBtn2').classList.remove('btnlight');document.getElementById('boxBtn3').classList.remove('btnlight');classList.add('btnlight')">未结算</div> <div id="boxBtn2" class="none-box2-btn-son" onclick = "document.getElementById('boxBtn1').classList.remove('btnlight');document.getElementById('boxBtn3').classList.remove('btnlight');classList.add('btnlight')">预约中</div> <div id="boxBtn3" class="none-box2-btn-son" onclick = "document.getElementById('boxBtn1').classList.remove('btnlight');document.getElementById('boxBtn2').classList.remove('btnlight');classList.add('btnlight')">已失效</div> </div>
效果:
标签:行内,删除,元素,js,添加,类名 From: https://www.cnblogs.com/zhainverer/p/17737003.html