1
I’m trying to change the text displayed by a span
within a modal:
<div class="modal-body">Deseja realmente excluir?<span id="nomecliente"></span></div>
I’m using onclick
to pass the value to use in jQuery.
<td style="text-align:center" onclick="Excluir(@item.nome)"><button class="btn btn-danger btn-circle btn-sm" data-toggle="modal" data-target="#excluirmodal"></button></td>
And my JS/jQuery function is this:
function Excluir(nome) {
$(document).ready(function () {
$('#nomecliente').html(nome);
})
}
I’ve tried to change the .html
for .text
and it didn’t work, and the weird thing is if I try to pass a number it works, displays in modal normally, but string I’m not getting.
Thanks for the help, it worked.
– André Luiz da Silva