慕侠2389804
根据这篇文章:oninput 通过用户界面更改元素的文本内容时发生事件。onchange当选择,选中状态或元素的内容已更改时发生。在某些情况下,仅当元素失去焦点时才会发生。该onchange属性可以使用:,,和。TL; DR:oninput:对文本内容所做的任何更改onchange:如果是:更改+失去重点如果是:更改选项$("input, select").on("input", function () { $("pre").prepend("\nOn input. | " + this.tagName);}).on("change", function () { $("pre").prepend("\nOn change | " + this.tagName);}).on("focus", function () { $("pre").prepend("\nOn focus | " + this.tagName);}).on("blur", function () { $("pre").prepend("\nOn blur | " + this.tagName);}); Alice Bob Carol Dave Emma