我正努力实现两件事:
我编写了以下代码,但如果我选择了除第一个单选按钮之外的其他任何单选按钮(在Visual中使用jQuery 3.1.1 ),删除后将无法检查第一个单选按钮:
$(':button').click(function (e) {
$(':radio:checked').closest('tr').remove();
$(':radio').first().attr("checked", true);
});
有人能告诉我我的密码有什么问题吗?
发布于 2016-12-22 17:46:13
使用prop()
方法更新元素属性。
$(':button').click(function (e) {
$(':radio:checked').closest('tr').remove();
$(':radio').first().prop("checked", true);
});
https://stackoverflow.com/questions/41289011
复制相似问题