ilovews

问题:

.html文件头部引入了:

<script src="js/jquery.js"></script>

<script src="js/jquery.mobile-1.3.2.min.js"></script>

使用jquery.mobile下radio控件:

<input type="radio" name="radio-choice" id="radio-choice-1" value="choice-1" checked="checked" />

<label for="radio-choice-1">Cat</label>

在自定义的.js文件中控制radio控件选中状态时,使用$(“input[type=\'radio\']”).attr("checked","checked");无效。

 

原因:

需要使用jquery.mobile下新定义的控制选中方法刷新:

$("input[type=\'radio\'] ").attr("checked",true).checkboxradio("refresh");

参考链接:http://jquerymobile.com/demos/1.2.1/docs/forms/radiobuttons/methods.html

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
猜你喜欢
  • 2022-01-25
  • 2021-07-30
  • 2022-12-23
  • 2021-08-19
  • 2022-02-10
  • 2022-12-23
相关资源
相似解决方案