由于选项只是select的值,因此您通常会将事件注册到 select-element 而不是 option-element。我不确定 DOM 规范是否允许这样做,但我现在也找不到任何可靠的来源。
As the option's are just values to the select, you will normally register events to the select-element instead of the option-element. I'm not sure if this is even allowed via the DOM-spec, but I also can't find any reliable sources right now.
发布评论
评论(1)
由于
选项
只是select
的值,因此您通常会将事件注册到 select-element 而不是 option-element。我不确定 DOM 规范是否允许这样做,但我现在也找不到任何可靠的来源。As the
option
's are just values to theselect
, you will normally register events to the select-element instead of the option-element. I'm not sure if this is even allowed via the DOM-spec, but I also can't find any reliable sources right now.