JSFiddle - React, Tailwind, and code Playground

HTML

<div onclick="one();">
text
</div>

JavaScript

window.one = function (Alert) {
	alert('AlertOneText');
};

window.two = function (Alert) {
	alert('AlertTwoText');
};

var getAtt = document.querySelector('div').getAttribute('onclick');
document.querySelector('div').setAttribute('onclick', getAtt + 'two();');

console.log(getAtt);