JSFiddle - React, Tailwind, and code Playground
HTML
<button id="buttonOne" onclick="pressOne()">Press</button>
JavaScript
$("button").attr("onclick","pressTwo()");
<button id="buttonOne" onclick="pressOne()">Press</button>
$("button").attr("onclick","pressTwo()");