JSFiddle - React, Tailwind, and code Playground
by ww9rivers
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/vader/jquery-ui.css">
<div id="wrapper">
<button id="add">Add Button</button>
</div>
JavaScript
jQuery("#add").click(
function ()
{
var test = jQuery('<button/>',
{
role: "button",
click: function () { alert('hi'); }
});
var icon = jQuery('<span class="ui-button-icon-primary ui-icon ui-icon-info" />');
var txt = jQuery('<span class="ui-button-text">Button with icon only</span>');
test.addClass("ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only").append(icon).append(txt);
jQuery("#wrapper").append(test);
var help = jQuery('<button/>').button(
{
icons: { primary: "ui-icon-help" },
label: "Help",
text: false
}).click(function () { alert('Help!'); });
jQuery("#wrapper").append(help);
});