title: How can I pass a custom argument to an event listener in JavaScript?
body: <p>How can I add an event listener (addEventListener(),attachEvent()) that also accepts a parameter?</p>
  
  <p>The parameter is passed as the element's custom attribute like:</p>
  
  <pre><code>&lt;img src="icon.gif" alt="Test button" command="test" /&gt;
  &lt;img src="icon2.gif" alt="Test button2" command="write" /&gt;
  </code></pre>