【发布时间】:2021-06-10 02:21:11
【问题描述】:
我正在尝试从按钮组中删除引导 active 类。
这是html代码
<div class="btn-group rounded-pill" data-toggle="buttons">
<label class="btn btn-outline-secondary btn-md active rounded-left">
<input type="radio" name="options" id="option1" value="cadpaymentform" checked> <b>Purchase</b>
</label>
<label class="btn btn-outline-secondary rounded-right btn-md">
<input type="radio" name="options" id="option2" value="license"> <b>My license key</b>
</label>
</div>
这是我尝试过的 jquery 代码,它删除了活动类,但是当页面完全加载时,它再次添加活动类。
$('.btn-group').find('.btn-outline-secondary').removeClass('active');
【问题讨论】:
-
嗨,你试过this方式吗?
标签: jquery twitter-bootstrap bootstrap-4