问题描述
我有一个项目需要一些值才能通过 HTML 单选更改事件使用 JavaScript 进行更新.
I have a project that requires some values to get updated with JavaScript from an HTML radio change event.
由于某种原因,在 IE 中,似乎直到收音机失去焦点后才会调用 onchange 事件.不幸的是,由于代码的设置方式,我不能使用 click 事件,必须使用 change 事件.
For some reason in IE, it seems that the onchange event isn't called until the radio has lost focus. Unfortunately due to the way the code is setup, I can't use the click event and have to use the change event.
有没有人知道一种方法可以强制 IE 在检查更改时而不是在失去焦点时引发更改事件?
Does anyone know of a way to force IE to raise the change event as soon as the check is changed rather than when it looses focus?
谢谢.
推荐答案
只需添加,可以通过onClick事件强制IE触发onChange事件,所以如果允许您使用 onClick 事件来触发更改事件,则应该这样做:
Just to add, you can force IE to trigger the onChange event using the onClick event, so if you are allowed use the onClick event to trigger the change event, this should do it:
<input type="radio" onclick="this.blur();"/>
这篇关于IE HTML 单选更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!





大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)