JavaScript - get attributes of clicked button
<p>This answer explains how you can get the ID of a clicked button.</p>

<p><a href="https://stackoverflow.com/questions/4825295/javascript-onclick-to-get-the-id-of-the-clicked-button">JavaScript - onClick to get the ID of the clicked button</a></p>

<p>However, can you also get other attributes of that button? E.g. <code>name</code> or <strong><a href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes" rel="noreferrer"><code>data-* attributes</code></a></strong> ?</p>