I'm using the jQuery tabs API, and I need to add a list of Add Buttons to a tab's content. What is the proper way to do this? When I try the following, nothing happens when I click the button:
$( function() {
$.createElement = function(name)
{
return $('<'+name+' />');
};
function addTab(objId){
// .... do stuff
for(i = 0; i < objIds.length; i++)
var b = $.createElement('button');
b.attr('title', 'adds a ' + label + ' tab');
b.attr('id', 'add_tab_'+createId());
// AddTab button: just opens the dialog
b.button().on( "click", function() {
addTab(objId[i]);
});
b.text(label);
buttonPanel.append(b);
tabs.append(buttonPanel);
} // for each objId
} // addTab
});