javascript的onchange事件是什么时候触发的
When is the onchange event triggered in javascript
有人可以解释一下在JS中触发onchange事件的时间吗?因为我正在制作多个下拉列表,其中每个下拉列表都取决于前一个的答案。但是所有 onchange 事件都在触发,即使 selectItemIndex 没有改变...
它在实际 .value
发生变化时发生,直到它失去焦点才正式发生。可以与 onblur
事件相同。检查 this page posted from this 问题以获取有关事件的更多信息。
我找到了这个
The onchange event occurs when the value of an element has been
changed.
For radiobuttons and checkboxes, the onchange event occurs when the
checked state has been changed.
Tip: This event is similar to the oninput event. The difference is
that the oninput event occurs immediately after the value of an
element has changed, while onchange occurs when the element loses
focus. The other difference is that the onchange event also works on
keygen and select elements.
你可以在这里看到更多http://www.w3schools.com/jsref/event_onchange.asp
如果您更改下拉菜单的内容,您也会触发 onchange 事件。
有人可以解释一下在JS中触发onchange事件的时间吗?因为我正在制作多个下拉列表,其中每个下拉列表都取决于前一个的答案。但是所有 onchange 事件都在触发,即使 selectItemIndex 没有改变...
它在实际 .value
发生变化时发生,直到它失去焦点才正式发生。可以与 onblur
事件相同。检查 this page posted from this 问题以获取有关事件的更多信息。
我找到了这个
The onchange event occurs when the value of an element has been changed.
For radiobuttons and checkboxes, the onchange event occurs when the checked state has been changed.
Tip: This event is similar to the oninput event. The difference is that the oninput event occurs immediately after the value of an element has changed, while onchange occurs when the element loses focus. The other difference is that the onchange event also works on keygen and select elements.
你可以在这里看到更多http://www.w3schools.com/jsref/event_onchange.asp
如果您更改下拉菜单的内容,您也会触发 onchange 事件。