1. <i id='Mfqbw'><tr id='Mfqbw'><dt id='Mfqbw'><q id='Mfqbw'><span id='Mfqbw'><b id='Mfqbw'><form id='Mfqbw'><ins id='Mfqbw'></ins><ul id='Mfqbw'></ul><sub id='Mfqbw'></sub></form><legend id='Mfqbw'></legend><bdo id='Mfqbw'><pre id='Mfqbw'><center id='Mfqbw'></center></pre></bdo></b><th id='Mfqbw'></th></span></q></dt></tr></i><div id='Mfqbw'><tfoot id='Mfqbw'></tfoot><dl id='Mfqbw'><fieldset id='Mfqbw'></fieldset></dl></div>

      2. <small id='Mfqbw'></small><noframes id='Mfqbw'>

        <tfoot id='Mfqbw'></tfoot>
        • <bdo id='Mfqbw'></bdo><ul id='Mfqbw'></ul>
        <legend id='Mfqbw'><style id='Mfqbw'><dir id='Mfqbw'><q id='Mfqbw'></q></dir></style></legend>

        Bootstrap 单选按钮“已选中"旗帜

        Bootstrap radio button quot;checkedquot; flag(Bootstrap 单选按钮“已选中旗帜)
        <i id='2amqz'><tr id='2amqz'><dt id='2amqz'><q id='2amqz'><span id='2amqz'><b id='2amqz'><form id='2amqz'><ins id='2amqz'></ins><ul id='2amqz'></ul><sub id='2amqz'></sub></form><legend id='2amqz'></legend><bdo id='2amqz'><pre id='2amqz'><center id='2amqz'></center></pre></bdo></b><th id='2amqz'></th></span></q></dt></tr></i><div id='2amqz'><tfoot id='2amqz'></tfoot><dl id='2amqz'><fieldset id='2amqz'></fieldset></dl></div>
      3. <tfoot id='2amqz'></tfoot>
          <legend id='2amqz'><style id='2amqz'><dir id='2amqz'><q id='2amqz'></q></dir></style></legend>

                <tbody id='2amqz'></tbody>

              <small id='2amqz'></small><noframes id='2amqz'>

              • <bdo id='2amqz'></bdo><ul id='2amqz'></ul>

                  本文介绍了Bootstrap 单选按钮“已选中"旗帜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果 #1 有效,则如果 #2 无效.检查下面的代码:

                  In case #1 works, in case #2 it do not works. Check the code bellow:

                  <div class="container">
                      <div class="row">
                          <h1>Radio Group #1</h1>
                          <label class="radio-inline">
                            <input name="radioGroup" id="radio1" value="option1" type="radio"> 1
                          </label>
                          <label class="radio-inline">
                            <input name="radioGroup" id="radio2" value="option2" checked="checked" type="radio"> 2
                          </label>
                          <label class="radio-inline">
                            <input name="radioGroup" id="radio3" value="option3" type="radio"> 3
                          </label>
                      </div>
                      <div class="row">
                          <h1>Radio Group #2</h1>
                          <label for="year" class="control-label input-group">Year</label>
                          <div class="btn-group" data-toggle="buttons">
                              <label class="btn btn-default">
                                  <input name="year" value="2011" type="radio">2011
                              </label>
                              <label class="btn btn-default">
                                  <input name="year" value="2012" type="radio">2012
                              </label>
                              <label class="btn btn-default">
                                  <input name="year" value="2013" checked="checked" type="radio">2013
                              </label>
                          </div>  
                      </div>  
                  </div>
                  

                  您可以在这里看到它的实际效果:http://bootply.com/84165

                  You can see it in action here: http://bootply.com/84165

                  推荐答案

                  假设您希望选中一个默认按钮.

                  Assuming you want a default button checked.

                  <div class="row">
                      <h1>Radio Group #2</h1>
                      <label for="year" class="control-label input-group">Year</label>
                      <div class="btn-group" data-toggle="buttons">
                          <label class="btn btn-default">
                              <input type="radio" name="year" value="2011">2011
                          </label>
                          <label class="btn btn-default">
                              <input type="radio" name="year" value="2012">2012
                          </label>
                          <label class="btn btn-default active">
                              <input type="radio" name="year" value="2013" checked="">2013
                          </label>
                      </div>
                    </div>
                  

                  active 类添加到您希望默认的按钮(label 标签),并将 checked="" 添加到它的 input 标记,因此默认以表单形式提交.

                  Add the active class to the button (label tag) you want defaulted and checked="" to its input tag so it gets submitted in the form by default.

                  这篇关于Bootstrap 单选按钮“已选中"旗帜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  keeping radio buttons checked after form submit(表单提交后保持选中单选按钮)
                  Styling radio button - not work in IE and Firefox(样式单选按钮 - 在 IE 和 Firefox 中不起作用)
                  Toggle HTML radio button by clicking its label(通过单击标签来切换 HTML 单选按钮)
                  Javascript how to change radio button label text?(Javascript如何更改单选按钮标签文本?)
                  How can I automatically select specific radio buttons with Greasemonkey?(如何使用 Greasemonkey 自动选择特定的单选按钮?)
                  AngularJs. Is it possible to deselect HTML “radio” input by click?(AngularJs.是否可以通过单击取消选择 HTML“收音机输入?)
                  <tfoot id='WaNRP'></tfoot>
                  • <small id='WaNRP'></small><noframes id='WaNRP'>

                      <i id='WaNRP'><tr id='WaNRP'><dt id='WaNRP'><q id='WaNRP'><span id='WaNRP'><b id='WaNRP'><form id='WaNRP'><ins id='WaNRP'></ins><ul id='WaNRP'></ul><sub id='WaNRP'></sub></form><legend id='WaNRP'></legend><bdo id='WaNRP'><pre id='WaNRP'><center id='WaNRP'></center></pre></bdo></b><th id='WaNRP'></th></span></q></dt></tr></i><div id='WaNRP'><tfoot id='WaNRP'></tfoot><dl id='WaNRP'><fieldset id='WaNRP'></fieldset></dl></div>

                        <tbody id='WaNRP'></tbody>

                        1. <legend id='WaNRP'><style id='WaNRP'><dir id='WaNRP'><q id='WaNRP'></q></dir></style></legend>
                          • <bdo id='WaNRP'></bdo><ul id='WaNRP'></ul>