JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test"></div>
JavaScript
$(document).ready(function () {
var name = { Name: "Stack", lastName:"Exchange" };
debugger;
$("#test").append('<a href="#" onclick="sendObj(\''+name.Name+'\')">sendObject</a>');
});
function sendObj(e)
{
alert(e);
//alert(e.Name) // if I just send the whole object(name) into the sendObj function
}