JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" id="input1" value="Boton1" onclick="prueba(this)"/>
<input type="button" id="input2" value="Boton2" onclick="prueba(this)"/>
<input type="button" id="input3" value="Boton3" onclick="prueba(this)"/>

JavaScript

function prueba(element){
alert($(element).attr("id"));
}