title: preventDefault and pass parameter for click event listener
body: <p>I want to stop the submit event for a button, but also pass a parameter into a function that is triggered from the click. Here's what I thought could work:</p>
  
  <pre><code>function NL(line, event){
    event.preventDefault();
    document.getElementsByClassName('new-line')[1].innerHTML=line;
  }
  document.getElementsByClassName('new-line')[0].addEventListener('click', function(){NL('add new line');});
  </code></pre>
  
  <p>Here's the HTML:</p>
  
  <pre><code>&lt;form class='myform'&gt;
    &lt;div class='form-block'&gt;
      &lt;span class='line'&gt;1&lt;/span&gt;
      &lt;button class='new-line'&gt;New Line&lt;/button&gt;
      &lt;button class='new-line'&gt;New 2nd Line&lt;/button&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I can't change the HTML, I can only edit the JS. Thanks in advance!!!</p>