JSFiddle - React, Tailwind, and code Playground

HTML

<body>
       

        <button onclick="doSomething('param');" id="id_button">action</button>
<button onclick="doSomething('param');" id="id_button1">action2</button>

        </body>

JavaScript

function doSomething(param,e)
        {
         if (!e)  e = window.event;
        var source1 = e.target || e.srcElement;
            console.log(source1.id);
        alert(source1.id);
        if(window.event) // IE8 and earlier
            {
            //doSomething
            }
        else if(e.which) // IE9/Firefox/Chrome/Opera/Safari
            {
            //doSomething
            }

        }