title: How to associate condition-reaction with document.querySelector?
body: <p>I don't know how to link the following condition-reactions to <em>passid</em> form input id:<br>
  I don't know where to put the <code>document.querySelector()</code> method so that indexed contion-reactions will be associated with it.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;Password - form&lt;/title&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
  
          &lt;form&gt;
              &lt;label&gt;Password&lt;/label&gt;
              &lt;input type="password" id="passid" /&gt;
              &lt;br&gt;
              &lt;input type="submit" value="Sign In" /&gt;
          &lt;/form&gt;
  
          &lt;script&gt;
  
              function passType() {
                  var password = ["p1", "p2", "p3", "p4", "p5"];
  
                  if (password.indexOf &gt; -1) {
                      alert("That's great! Thank you!");
                  } else {
                      alert("Wrong, try again");
                  }
  
                  if (password.indexOf &gt; -1) {
                      alert("It's wrong, you have one more try...");
                  } else {
                      alert("Get out now!");
                      window.close();
                  }
              }
          passType();
  
      &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>How should this be done?</p>