I have a problem that was recently presented to me. I need the value of a input
found in a table in the second row when I press a button that is in the third row, using jquery
and parent
.
I show you an example:
<table>
<tbody>
<tr>
<td>
Servicio
</td>
</tr>
<tr>
<td>
<input type="hidden" value="">
</td>
</tr>
<tr>
<td>
<input type="button" value="Atendido" id="atendido">
</td>
</tr>
</tbody>
What I have so far is:
$(document).on("click", "#atendido", function(e){
var aux;
aux=$(this).parent().parent().parent();
alert(aux);
});
but I still do not know how to get to input
to get the value of it, I got stuck.
Thanks for your help.