IE 无法在单选按钮上使用 "return false"

IE can't use "return false" on radio button

我使用如下的 js 来防止点击某些单选按钮。

它在 Chrome 中工作得很好。

但是在IE8上还是无法查看,但是点击组中的其他radio默认值消失了

 $("body").on("change", ".readonly", function () {
    return false;
});

我怎样才能使收音机只读并在 IE8 上工作?

<input type="radio" readonly /> 不起作用,但使用点击确实部分起作用。如果您有两个同名的收音机,IE 仍然会取消选中已选中的收音机,而不管使用此代码

$("body").on("click", ".readonly", function(e) {
  e.preventDefault();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<input name="rad" type="radio" class="readonly" />
<input name="rad" type="radio" checked class="readonly" />


这是一个解决方案:

$(function() {
  $(':radio:not(:checked)').attr('disabled', true);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<input name="rad" type="radio" class="readonly" />
<input name="rad" type="radio" checked class="readonly" />