JSFiddle - React, Tailwind, and code Playground
HTML
<a id="test">Тестовая</a>
JavaScript
function fun1(param) {
if (typeof param['button'] !== 'undefined') {
for (var i = 0; i < param['button'].length; i++) {
var element = param['button'][i];
if (typeof element['onclick'] !== 'undefined') $('#test').click(element['onclick']('abcdef'));
}
}
}
var p = {};
p['button'] = [{
'onclick': function (param) {
return function () {
$('#test').html(param);
}
}
}];
fun1(p);