| | |||
|
One strange difference in my opinion between Firefox and Internet Explorer and most strange of all also a difference to Google Chrome is that the onclick-event is not recnognized. Here is a simple example just to illustrate.
This works fine in Firefox, i.e. the function 'getCategories' gets called when choosing an object in the select box. This does not work for the other browsers though, the calls are not made and there are even no errors raised. The solution is to make the function call on the select-tag instead using the onchange-event referencing the value of the select tag (which will hold the value of the chosen option-tag),
This way it will work for all three browsers! | |||
Replacing the onclick event for IE or Chrome ZZ
最新推荐文章于 2022-06-11 14:21:08 发布
本文探讨了在不同浏览器中处理点击事件的方法,特别是针对<select>元素的onclick事件在Firefox、Internet Explorer及Google Chrome中的表现差异,并提供了一种适用于所有三种浏览器的解决方案。
1590

被折叠的 条评论
为什么被折叠?



