JSFiddle - React, Tailwind, and code Playground
HTML
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.0/themes/base/jquery-ui.css" rel="stylesheet" />
<h2>Boom</h2>
<input type="submit" id="test" />
<div>Woo a dialog</div>
CSS
body { padding:20px; color:#242424; font-family: "Lucida Grande", Tahoma, "Trebuchet MS"; }
h2 { background:#5279a4; color:#fff; padding:5px; }
div { padding:5px; }
JavaScript
// mcpDESIGNS
$("div").dialog({
modal: true,
resizable: false,
buttons: {
"Ok": function () {
//save confirmations
$(this).dialog("close");
setTimeout(function () {
clickButton(true);
}, 100);
},
"No": function() {
$(this).dialog("close");
setTimeout(function () {
clickButton(false);
}, 100);
}
}
});
function clickButton(b) {
document.getElementById('test').click();
}
$('#test').on('click', function () { alert('SUBMIT EVENT CLICKED'); });