gpt4 book ai didi

jquery - jQuery 设置复选框在 IE6 中选中时出现问题(未显示为选中状态?)

转载 作者:行者123 更新时间:2023-12-01 03:05:20 24 4
gpt4 key购买 nike

代码:

var lstInstanceIds = getData.lstInstanceIds.split(',');
for(var i=0; i<lstInstanceIds.length; i++) {
var value = lstInstanceIds[i];
$('input[value=' + value + ']').attr('checked','checked');
}

所以我所做的就是循环一个列表并将检查的属性设置为在值相遇的地方检查。

这在 Chrome、Firefox、IE7/8、Safari 中运行良好。但在 IE6 中不行...

最佳答案

改用attr('checked', true)

关于jquery - jQuery 设置复选框在 IE6 中选中时出现问题(未显示为选中状态?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2561664/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com