radio checked 没有反应

来源:互联网 发布:直播电视软件 编辑:程序博客网 时间:2024/04/30 23:26



基本都是jquery的版本原因造成attr方法不能正常使用。为了解决这一问题 jquery引入了prop方法。用法基本和attr差不多。

var i=1;

 $("input[name='matter']").each(function() {                            if ($(this).val() == i) {                                $(this).prop('checked',true);                            }else{                                $(this).prop('checked',false);                            }                        });





原创粉丝点击