title: How do you submit parameters from a input tag into a form onsubmit attribute in HTML?
body: <p>I have 3 inputs, and I want to put their values into the form onsubmit attribute function. Here's my current code. I would like a way to do this that won't require me to create 3 variables using <code>getElementById()</code> or <code>querySelector()</code>, preferably in the HTML file, but if it's impossible, I'll accept defeat.</p>
  <pre><code>    &lt;form id=&quot;form&quot; onsubmit=&quot;addUserCredentials(userID, username, email)&quot;&gt;
        &lt;input type=&quot;text&quot; id=&quot;userID&quot; name=&quot;userID&quot;&gt;&lt;/input&gt;
          &lt;label for=&quot;userID&quot;&gt;User ID&lt;/label&gt;
        
        &lt;input type=&quot;text&quot; id=&quot;username&quot; name=&quot;username&quot;&gt;&lt;/input&gt;
          &lt;label for=&quot;username&quot;&gt;Username&lt;/label&gt;
        
        &lt;input type=&quot;text&quot; id=&quot;email&quot; name=&quot;email&quot;&gt;&lt;/input&gt;
          &lt;label for=&quot;email&quot;&gt;Email Address&lt;/label&gt;
  
        &lt;button&gt;Submit&lt;/button&gt;
      &lt;/form&gt;
  </code></pre>
  <p><strong>p.s. here's script.js if you want to look (and yes, i'm using firebase)</strong></p>
  <pre><code>function addUserCredentials(userId, username, email) {
    db.ref('users/' + userId).set({
      username: username,
      email: email
    });
  }
  </code></pre>