JSFiddle - React, Tailwind, and code Playground
HTML
<div onclick="one(1);">
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(2);');
console.log(getAtt);