title: Temporarily disable an input field if second input field is filled
body: <p>I'm attempting to disable an input while the user is filling another input. I've managed to disable one of the two inputs while the other input is being filled in. </p>
  
  <p>The problem is that I want the disabled input to ONLY be disabled WHILE the other input is being typed in. 
  So if the user changes their mind on the 1st input, they can delete what is in the current input which makes the 2nd input available and the 1st disabled.</p>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var inp1 = document.getElementById("input1");
  inp1.onchange = function () {
     if (this.value != "" || this.value.length &gt; 0) {
        document.getElementById("input2").disabled = true;
     }
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input type="text" id="input1"&gt;
  &lt;input type="text" id="input2"&gt;
  </code></pre>