JSFiddle - React, Tailwind, and code Playground

HTML

<input type="button" onclick="alert('clicked')" />
<input type="button" onclick="redirect(event)" />

JavaScript

window.redirect = function redirect(event) {
	var ne = event.constructor(event.type, event);
  document.querySelector('input').dispatchEvent(ne);
}