JSFiddle - React, Tailwind, and code Playground

HTML

<button name="X" data-other-attr='XX' onClick="reply_click(this)">Button</button>

JavaScript

function reply_click(clicked_object)
{
     alert(clicked_object.getAttribute('name'));
     alert(clicked_object.getAttribute('data-other-attr'));
}