title: Triggering a button click from javascript
body: <p>Let's suppose I have a form with some input fields and a submit button. </p>
  
  <p>If I use the <code>window.onunload</code>, is it possible for me to trigger the submit button before the user leaves the webpage.</p>
  
  <p>Which would be the correct way to implement it.</p>