You should use
$('tr');
to create a tr
element, instead of
$(document.createElement('tr'));
because, you are using jQuery
and jQuery
will take care of that. To create any element using jQuery
you just supply the name of that element/tag
, for example, to create a td
you can use
var td = $('td');
for a div, just use
var div = $('div');
That's it.
Update: In your code you have
var nueva fila = $(document.createElement('tr'));
here, nueva fila
is not a valid variable name, it should be a single word, without any spaces, like
var nuevafila = $('tr');
or you can use
var nueva_fila = $('tr');
Check Variables on MDN.