I'm starting to work with JQUERY in my project in which I generate a table from a function with AJAX, for each record besides the data, I generate a column with a button to edit, the problem is that I need to press the edit button; on the same value column (Total Amount), an input with the value of this appears and you can edit it from your site. I attach an image of what my table generates .
I need that when clicking on edit, an input appears with the amount in this case 30.00 and I can edit it from there. This is my function:
function get(){
var id = $('#Id').val();
$.ajax({
url:baseurl+"reserva/get",
type:"POST",
data:{id:id},
success:function(data){
var registros = eval(data);
html ="<table class='table'><thead>";
html +="<tr><th>#</th><th>Total Monto</th><th>Fecha de Registro</th><th>Opciones</th></tr>";
html +="</thead><tbody>";
for (var i = 0; i < registros.length; i++) {
html +="<tr><td>"+registros[i]["contador"]+"</td><td>"+registros[i]["Monto"]+" </td><td>"+registros[i]["Fecha"]+"</td><td><a title='Editar' class='btn btn-sm btn-squared margin-inline'><i class='fa fa-pencil' aria-hidden='true'></i></a></td></tr>";
};
$("#lista").html(html);
}
}
});
}