如何使用jQuery获取Twitter Bootstrap切换开关值 [英] How to get twitter bootstrap toggle switch values using jquery

查看:180
本文介绍了如何使用jQuery获取Twitter Bootstrap切换开关值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 http://bootstrapswitch.site/用于切换开关按钮.如何使用jQuery获得打开"或关闭"之类的切换开关?

I am using http://bootstrapswitch.site/ for toggle switch buttons. How can I get the toggle switch like 'on' or 'off' using jQuery?

我的代码是:

<div class="make-switch  switch-small"><input type="radio" class="nsfw"></div>

请告诉我如何解决此问题.

Please tell me how to solve this issue.

推荐答案

$('#switcher').bootstrapSwitch('state'); // true || false
$('#switcher').bootstrapSwitch('toggleState');

请参阅此链接以获取更多功能

这篇关于如何使用jQuery获取Twitter Bootstrap切换开关值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆