79416550

Date: 2025-02-06 01:00:49
Score: 1.5
Natty:
Report link

why not use .onkeyup?

<input id="input1"></input>
<input id="input2"></input>
var input1,input2;
input1= document.getElementById("input1");
input2 = document.getElementById("input2");
input1.onkeyup = function () { input2.value = input1.value; };
//now if you want to copy edits from input2 to input1
// input2.onkeyup = function () { input1.value = input1.value; };

.onkeyup listens for things after you release the key from your keyboard, automatically firing a script after a change is made

Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Starts with a question (0.5): why not use
  • Low reputation (1):
Posted by: The Heavy