Imagine I find myself exploring an online form that utilizes Material UI components, for instance, this example link.
I am interested in automatically filling the input fields with a specific value using JavaScript in the console:
for (input of document.getElementsByTagName('input')) {
input.value = "new value";
console.log(input.value);
}
Initially, it seems to work since the input fields reflect the updated values and the console logs confirm the change. However, despite this, the visual display showing "Your input value is: test" remains unchanged and reverting back once the input field is clicked.
Is there a way to create an external JavaScript script that can truly alter the input field's value? It appears to be more complex than expected—possibly involving event dispatching methods?