Solution 1 :

To synchronize all text boxes on the page, you could do something like this:

document.addEventListener("input",function(e) {
  if (e.target.matches("input[type=text]")) {
    document.querySelectorAll("input[type=text]").forEach(function(a) {
      a.value = e.target.value;
    });
  }
});

Problem :

I’m currently using Tampermonkey to inject JavaScript into specific web pages.

For my job, I have to constantly fill in numerous text boxes on the same web page with the same exact information. So instead of manually copying and pasting everything to each separate text box, I’d like to be able to synchronize my input on one text box with another. So as an example, theoretically, I could type “dog” into the first box, and the word “dog” would appear in the second box automatically. Is this possible in Tampermonkey via JavaScript?

I’m assuming <input type="text"> and/or an element ID or name could be used to link the interaction of two elements on a specific page?

I’m not exactly sure where to get started here, so any and all advice would be deeply appreciated.

By