Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ruancarvalho
Created April 9, 2016 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ruancarvalho/5eb669e82bf071e8b69b175acd79ecd9 to your computer and use it in GitHub Desktop.
Save ruancarvalho/5eb669e82bf071e8b69b175acd79ecd9 to your computer and use it in GitHub Desktop.
Função AddTableRow com jQuery
(function($) {
AddTableRow = function() {
var newRow = $("<tr>");
var cols = "";
cols += '<td>&nbsp;</td>';
cols += '<td>&nbsp;</td>';
cols += '<td>&nbsp;</td>';
cols += '<td>&nbsp;</td>';
cols += '<td>';
cols += '<button onclick="RemoveTableRow(this)" type="button">Remover</button>';
cols += '</td>';
newRow.append(cols);
$("#products-table").append(newRow);
return false;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment