From 0f27debb8bedcbe29b393337d1567d04b336e8b6 Mon Sep 17 00:00:00 2001 From: wbamberg Date: Thu, 14 Sep 2023 10:18:59 -0700 Subject: [PATCH] Fix issue 27044: input is not fired when value is changed programmatically --- files/en-us/web/api/htmlelement/input_event/index.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/en-us/web/api/htmlelement/input_event/index.md b/files/en-us/web/api/htmlelement/input_event/index.md index d2fab5fbe48b619..315cab027e32506 100644 --- a/files/en-us/web/api/htmlelement/input_event/index.md +++ b/files/en-us/web/api/htmlelement/input_event/index.md @@ -8,7 +8,7 @@ browser-compat: api.HTMLElement.input_event {{APIRef}} -The **`input`** event fires when the `value` of an {{HTMLElement("input")}}, {{HTMLElement("select")}}, or {{HTMLElement("textarea")}} element has been changed. +The **`input`** event fires when the `value` of an {{HTMLElement("input")}}, {{HTMLElement("select")}}, or {{HTMLElement("textarea")}} element has been changed as a direct result of a user action (such as typing in a textbox or checking a checkbox). The event also applies to elements with {{domxref("HTMLElement.contentEditable", "contenteditable")}} enabled, and to any element when {{domxref("Document.designMode", "designMode")}} is turned on. In the case of `contenteditable` and `designMode`, the event target is the _editing host_. If these properties apply to multiple elements, the editing host is the nearest ancestor element whose parent isn't editable. @@ -16,7 +16,9 @@ For `` elements with `type=checkbox` or `type=radio`, the `input` event s For {{htmlelement("textarea")}} and {{htmlelement("input")}} elements that accept text input (`type=text`, `type=tel`, etc.), the interface is {{DOMxRef("InputEvent")}}; for others, the interface is {{DOMxRef("Event")}}. -> **Note:** The `input` event is fired every time the `value` of the element changes. This is unlike the {{domxref("HTMLElement/change_event", "change")}} event, which only fires when the value is committed, such as by pressing the enter key, selecting a value from a list of options, and the like. +The `input` event is fired every time the `value` of the element changes. This is unlike the {{domxref("HTMLElement/change_event", "change")}} event, which only fires when the value is committed, such as by pressing the enter key, selecting a value from a list of options, and the like. + +Note that the `input` event is not fired when an element's `value` is changed programmatically using JavaScript. ## Syntax