<input> <input> <script> inputs = Array.from(document.querySelectorAll("input")) inputs.forEach(input => {input.oninput = function(){inputs[0].value = inputs[1].value = this.value}}) </script>