title: How to bind anonymous function to form's onsubmit and then access that form's contents for AJAX submit?
body: <p>I can't figure out how to attach an anonymous function to a onsubmit event of a form. I want to bind anonymous AJAX JS logic to a feedback form. I don't want to rely on unique ids.</p>
  
  <p>I was using</p>
  
  <pre><code>feedbackform.onsubmit = function (e) {
  </code></pre>
  
  <p>But that doesn't work well if I have several of the <a href="https://github.com/kaihendry/vanilla-php-feedback-form/blob/master/feedback/index.html" rel="nofollow">same <em>feedbackform</em> forms</a> embedded.</p>
  
  <p>A way forward might be to use <code>onsubmit="return feedback()"</code>, however I can't work out how to access the form's content from the <a href="https://github.com/kaihendry/vanilla-php-feedback-form/blob/master/feedback/feedback.js" rel="nofollow">feedback function</a>.</p>