title: How do I detect when input value changes real-time in JavaScript?
body: <p>I'm trying to get my input field element to remove a class immediately after the input value changes. Currently, I'm able to detect the changes and remove the class 'invalid', but only after the input field is inactive. Here's my code;</p>
  
  <pre><code>fieldsArr.forEach(el =&gt; {
              el.addEventListener('change', function() {
                  this.classList.remove('invalid');
              });
          });
  </code></pre>