Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I have added some input to an input field element this way: const inputFiled = document.querySelector("#example"); inputField.value = "X"; I want to fire a change event for that field right af...
#3: Post edited
I have added some input to an input field element this way:- ```js
- const inputFiled = document.querySelector("#example");
- inputField.value = "X";
- ```
- I want to fire a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for that field right after the input was added.
- This is something I want to try after noticing that the input isn't recognized (the form won't be submitted) if added in the above way; rather, it is recognized only by typing/pasting.
- How to do that?
- I have added some input to an input field element this way:
- ```js
- const inputFiled = document.querySelector("#example");
- inputField.value = "X";
- ```
- I want to fire a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for that field right after the input was added.
- This is something I want to try after noticing that the input isn't recognized (the form won't be submitted) if added in the above way; rather, it is recognized only by typing/pasting.
- How to do that?
#2: Post edited
- I have added some input to an input field element this way:
- ```js
- const inputFiled = document.querySelector("#example");
- inputField.value = "X";
- ```
- I want to fire a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for that field right after the input was added.
This is something I want to try after noticing that the input isn't recognized if added in the above way (rather, it is recognized only by typing/pasting).- How to do that?
- I have added some input to an input field element this way:
- ```js
- const inputFiled = document.querySelector("#example");
- inputField.value = "X";
- ```
- I want to fire a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for that field right after the input was added.
- This is something I want to try after noticing that the input isn't recognized (the form won't be submitted) if added in the above way; rather, it is recognized only by typing/pasting.
- How to do that?
#1: Initial revision
How to fire the change event for an input field?
I have added some input to an input field element this way: ```js const inputFiled = document.querySelector("#example"); inputField.value = "X"; ``` I want to fire a [change event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event) for that field right after the input was added. This is something I want to try after noticing that the input isn't recognized if added in the above way (rather, it is recognized only by typing/pasting). How to do that?