【发布时间】:2019-05-06 10:42:37
【问题描述】:
复选框默认选中无效! 我试图修复它,但我找不到这里的错误? 所以在页面加载被选中,在页面加载后未被选中!? 我试过了
<div class="onoffswitch" style="margin: 0 auto;">
<input type="checkbox" class="avacheckbox onoffswitch-checkbox" id="AvButtonAutoGames" checked="checked"/>
<label class="onoffswitch-label" for="AvButtonAutoGames">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
还有那个
<div class="onoffswitch" style="margin: 0 auto;">
<input type="checkbox" class="avacheckbox onoffswitch-checkbox" id="AvButtonAutoGames" checked/>
<label class="onoffswitch-label" for="AvButtonAutoGames">
<span class="onoffswitch-inner"></span>
<span class="onoffswitch-switch"></span>
</label>
</div>
【问题讨论】:
-
实际上,您的代码适用于我的
<input checked />并检查MDN,那么您到底需要什么?
标签: javascript jquery html checkbox