Here I call the mask using class
$(function($){
$(".dinheiro").maskMoney();
});
In the form's input it works normal, but inside table does not work.
function addProd(obj) {
$('#add_prod').val('');
var id = $(obj).attr('data-id');
var name = $(obj).attr('data-name');
var price = $(obj).attr('data-price');
$('.searchresults').hide();
if ($('input[name="quant[' + id + ']"]').length == 0) {
var tr =
'<tr>' +
'<td>' + id + ' - ' + name + '</td>' +
'<td>' +
'<input type="number" name="quant" class="p_quant" value="1" onchange="updateSubtotal(this)" data-price="' + price + '" />' +
'</td>' +
'<td>' + price + '</td>' +
'<td>' +
'<input type="text" name="servico[' + id.trim() + ']" class="servico" onkeyup="carregaServico(this)" id="servico[' + id.trim() + ']" data-type="search_servico" />' +
'</td>' +
'<td width="10%" class="dinheiro">' +
'<input type="text" name="vlr_servico[' + id.trim() + ']" data-id="' + id + '" onblur="formataDinheiro(this)" id="vlr_servico[' + id.trim() + ']" class="dinheiro" />' +
'</td>' +
'<td class="subtotal">' + price + '</td>' +
'<td><a href="javascript:;" onclick="excluirProd(this)">Excluir</a></td>' +
'</tr>';
$('#products_table').append(tr);
}
updateTotal();
}