简体   繁体   English

IE似乎取消了不确定的复选框,而Chrome和FF会在单击时对其进行检查

[英]IE seems to uncheck an indeterminate checkbox whereas Chrome and FF will check it on click

IE seems to uncheck an indeterminate checkbox on click whereas Chrome and FF will check it on click. IE似乎取消选中了不确定的复选框,而Chrome和FF则选中了它。 Can any one confirm this behavior and perhaps suggest a way to make the behavior uniform across all browsers? 任何人都可以确认这一行为,并可能提出一种使行为在所有浏览器中保持一致的方法吗?

This is IE8,9,10 and all versions of chrome and FF less than a year old. 这是IE8、9、10,所有版本的chrome和FF都不到一年。

fake code so I can submit jsFiddle link, that's weird....

Head over to this fiddle for an example. 头部到这个捣鼓的一个例子。

Check about.html and index.html then Kendo UI Project 检查about.htmlindex.html,然后检查Kendo UI项目

Notice how IE yields a different result. 注意IE如何产生不同的结果。

As you are using jQuery in your fiddle, I've removed the onclick handlers from the inputs , and targeted them directly from the JavaScript. 当您在小提琴中使用jQuery时,我从inputs删除了onclick处理程序,并直接从JavaScript中定位了它们。 Live Demo: http://jsfiddle.net/JEDBG/1/ 现场演示: http//jsfiddle.net/JEDBG/1/

$('body').on('click', 'input', function () {
    $('#result').html('<br/>state: ' + this.checked);
});

IE now produces the expected result. IE现在产生预期的结果。

ps Don't be alarmed by the difference in our fiddles. ps不要被我们的小提琴中的差异所震惊。 I have just included the external resources the way jsfiddle prefers and moved the different code languages into their respective panels. 我刚刚包括了jsfiddle所喜欢的外部资源,并将不同的代码语言移到了各自的面板中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM