gpt4 book ai didi

jquery - 为什么我的 jQuery checkbox.change 事件仅在 IE 中的 leftfocus 上触发,但在 FF 中却在 onclick 上触发?

转载 作者:行者123 更新时间:2023-12-03 22:40:02 25 4
gpt4 key购买 nike

    $(".feature").change(function(){
getProductSelections();
});

啊啊啊!!

最佳答案

Web Bug Track:

The onchange event can be attached (inline or as an event handler) to any form element. It fires whenever the value of the form field changes. Unfortunately, the behavior is a bit strange in IE, in that for a checkbox, or a radio button field, the event doesn't fire when it is supposed to (right when you click the option you want to choose), but instead it only fires, when you click elsewhere on the page/form, or if you explicitly call blur(); on the field.

建议的解决方法是:

<input type="radio" name="foo" value="Green" onclick="alert(this.value);"/>Green
<input type="radio" name="foo" value="Blue" onclick="alert(this.value);"/>Blue

关于jquery - 为什么我的 jQuery checkbox.change 事件仅在 IE 中的 leftfocus 上触发,但在 FF 中却在 onclick 上触发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1501743/

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