In the above table row I have two disabled inputs in columns vlcontrato
and valor
. I would like that when I click the alterar
button these two inputs are enabled so that I can edit them.
Since they are on the same line I tried to use the siblings method but I only succeeded if the alterar
button was within the same td
as the input, but the button has to be in a td
independent as in the image above!
How do I proceed to get this operation?!
$('tr td .btn_alt').click(function(){
$(this).siblings('input[name=vlcontrato]').attr('readonly', false);
$(this).siblings('input[name=vlcontrato]').focus();
});