I have a modal which has two functions, to record the data received by ajax
in tags <span class="nombre"></span>
and the other alternative is to be able to give the user the option that when he presses a button that data becomes a form ...
the function is the following:
to show the data without editing use $('.nombre').html(data[0].nombre);
but I want that when you press the "editar"
button change that $('.nombre').html(data[0].nombre);
for the $('.nombre').val(data[0].nombre);
, with what purpose? so that you do not have to return to make an ajax call to re-format the data in the inputs
of the form to be edited.
since if I use $('.nombre').html(data[0].nombre);
, that data will not be shown in the input
of the form.
I hope you have made me understand and I would appreciate the interest