<small id='PsHkB'></small><noframes id='PsHkB'>

      <tfoot id='PsHkB'></tfoot>
        <bdo id='PsHkB'></bdo><ul id='PsHkB'></ul>

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

        AngularJs.是否可以通过单击取消选择 HTML“收音机"输入?

        时间:2023-10-21

            <tbody id='EhGbu'></tbody>
        • <small id='EhGbu'></small><noframes id='EhGbu'>

            <i id='EhGbu'><tr id='EhGbu'><dt id='EhGbu'><q id='EhGbu'><span id='EhGbu'><b id='EhGbu'><form id='EhGbu'><ins id='EhGbu'></ins><ul id='EhGbu'></ul><sub id='EhGbu'></sub></form><legend id='EhGbu'></legend><bdo id='EhGbu'><pre id='EhGbu'><center id='EhGbu'></center></pre></bdo></b><th id='EhGbu'></th></span></q></dt></tr></i><div id='EhGbu'><tfoot id='EhGbu'></tfoot><dl id='EhGbu'><fieldset id='EhGbu'></fieldset></dl></div>
            <tfoot id='EhGbu'></tfoot>
                <bdo id='EhGbu'></bdo><ul id='EhGbu'></ul>
                  <legend id='EhGbu'><style id='EhGbu'><dir id='EhGbu'><q id='EhGbu'></q></dir></style></legend>
                1. 本文介绍了AngularJs.是否可以通过单击取消选择 HTML“收音机"输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I have radio inputs and want to ucheck state by click on radio if current radio is checked.

                  This code:

                  <input type="radio" id="average_0" name="average" ng-model="checked" ng-change="false" value="500" class="ng-valid ng-dirty">
                  <input type="radio" id="average_1" name="average" ng-model="checked" ng-change="false" value="1000" class="ng-valid ng-dirty">
                  <input type="radio" id="average_2" name="average" ng-model="checked" ng-change="false" value="1500" class="ng-valid ng-dirty">
                  

                  Not working.

                  Fiddle: http://jsfiddle.net/Zoomer/8s4m2e5e/

                  解决方案

                  Radio buttons can be selected only one at a time and cannot be unchecked by the user once they are checked (unless you do programmatically). So if you want to uncheck it when it is currently selected, you can do this:

                  <input type="radio" ng-model="checked" value="500" ng-click="uncheck($event)" />
                  <input type="radio" ng-model="checked" value="1000" ng-click="uncheck($event)" />
                  <input type="radio" ng-model="checked" value="1500" ng-click="uncheck($event)" />
                  

                  In your controller:

                  $scope.uncheck = function (event) {
                      if ($scope.checked == event.target.value)
                          $scope.checked = false
                  }
                  

                  DEMO: http://jsfiddle.net/8s4m2e5e/3/

                  NOTE: If you really want to choose one or none from many options, you may opt for a <select>

                  这篇关于AngularJs.是否可以通过单击取消选择 HTML“收音机"输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在html中自定义单选按钮 下一篇:如何使用 Greasemonkey 自动选择特定的单选按钮?

                  相关文章

                    <bdo id='0F4CJ'></bdo><ul id='0F4CJ'></ul>
                2. <small id='0F4CJ'></small><noframes id='0F4CJ'>

                  1. <tfoot id='0F4CJ'></tfoot>

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