You can modify the element, of the DOM with jQuery.
That is, declare it as a Button and then with jQuery convert it to text.
or when I have a table with records do not double click on a td it becomes an input text where I can modify it?
I was proving with attr
or prop
, I do not know if I'm wrong or esque you can not
$('button').dblclick(function() {
editar();
});
function editar(){
$('button').attr("type", 'input');
console.log('Estas adentro');
}
$('#tabla tbody tr > td').dblclick(function() {
$(this).css('color', 'red');
//$(elemento).prop("button");
//$(this).html("Hola");
console.log($(this).html());
editar();
//alert();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button>Toca me dos veces seguido</button><br>
<table id="tabla" border=1>
<tr>MI NOMBRE COMPLETO</tr>
<td>Ivan</td>
<td>Joel</td>
<td>More</td>
<td>Flores</td>
<tr></tr>
<td>Ivan</td>
<td>Joel</td>
<td>More</td>
<td>Flores</td>
<tr></tr>
<td>Ivan</td>
<td>Joel</td>
<td>More</td>
<td>Flores</td>
<tr></tr>
<td>Ivan</td>
<td>Joel</td>
<td>More</td>
<td>Flores</td>
<tr></tr>
<td>Ivan</td>
<td>Joel</td>
<td>More</td>
<td>Flores</td>
</table>