【问题标题】:How to change the radio button selection in IE 7?如何更改 IE 7 中的单选按钮选择?
【发布时间】:2011-05-22 23:59:44
【问题描述】:

我正在使用 Knockout javascript 库,我遇到了这个问题:我无法更改 IE7 中的单选按钮选择。

例如,在我的页面上,我无法像 controlTypes example 那样使用 IE 7 更改单选按钮选择。

这个问题有解决办法吗?

【问题讨论】:

    标签: javascript knockout.js


    【解决方案1】:

    我找到了解决方案。通过为组中的所有单选按钮添加具有相同值的名称属性(name="planetType",见下文),IE 也会很高兴...

    <label><input type="radio" value="all" data-bind="checked: typeToShow" name="planetType" />All</label>     
    <label><input type="radio" value="rock" data-bind="checked: typeToShow" name="planetType"/>Rocky planets</label>     
    <label><input type="radio" value="gasgiant" data-bind="checked: typeToShow" name="planetType"/>Gas giants</label>
    

    【讨论】:

      猜你喜欢
      • 2010-10-31
      • 2014-07-20
      • 2012-06-09
      • 1970-01-01
      • 2021-04-09
      • 2016-07-19
      • 2017-12-07
      • 1970-01-01
      • 2011-02-15
      相关资源
      最近更新 更多