Javascript 如何使用方法:$().button(';toggle';)进行此引导';单选按钮列表';? 活跃的 无线电 无线电
$()。按钮(“切换”):切换推送状态。使按钮具有已激活的外观 RadioButtonList的图像截图。从最左边的按钮可以看到,它看起来像是在单击时被单击过 我目前正在制作的登录页面截图。当我点击任一“单选”按钮时,它们的外观没有改变,因此我必须使用方法$().button(“toggle”),但我不知道在哪里或如何使用它Javascript 如何使用方法:$().button(';toggle';)进行此引导';单选按钮列表';? 活跃的 无线电 无线电,javascript,html,bootstrap-4,Javascript,Html,Bootstrap 4,$()。按钮(“切换”):切换推送状态。使按钮具有已激活的外观 RadioButtonList的图像截图。从最左边的按钮可以看到,它看起来像是在单击时被单击过 我目前正在制作的登录页面截图。当我点击任一“单选”按钮时,它们的外观没有改变,因此我必须使用方法$().button(“toggle”),但我不知道在哪里或如何使用它 只需将正确的选择器添加到jQuery函数中即可。请尝试使用此选项: <div class="btn-group btn-group-toggle" data-tog
只需将正确的选择器添加到jQuery函数中即可。请尝试使用此选项:
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-secondary active">
<input type="radio" name="options" id="option1" autocomplete="off"
checked> Active
</label>
<label class="btn btn-secondary">
<input type="radio" name="options" id="option2" autocomplete="off">
Radio
</label>
<label class="btn btn-secondary">
<input type="radio" name="options" id="option3" autocomplete="off">
Radio
</label>
</div>
现在你的代码应该可以工作了
希望这有帮助 你想用你的代码实现什么?你想用javascript/jquery代码切换点击的状态吗?是@RamondeVries。我不知道把$().button('toggle')方法放在哪里或如何使用。你有没有少用
$().button('toggle')
或类似的东西$('.btn group')。button('toggle')
?是的,实际上已经用了@ramondevries对不起,伙计们真的很笨,但我没有把JavaScript和JQuery脚本src正确地放进我的HTML文件中。
$(".btn-group").button("toggle");