javascript - How to remove the attribute "disabled" from input siblings when i click on a submit input -
i have problem: need remove "disabled" attibute siblings inputs of submit input. here html:
<td> <input type="hidden" value="2000000000002_statuto_07_10_2010.gif" name="nomedocumento" disabled="true"> <input type="hidden" value="811ecdd0-65e9-49d6-8d9d-8b7c9d9b6407" name="uuid" disabled="true"> <input type="submit" value="cancella" name="cancella"> </td>
i need simple way using jquery remove disable attribute when click on submit. tried:
$('input[name=cancella]').click(function(){ $('this').prev().removeattr('disabled'); $('this').prev().prev().removeattr('disabled'); }
but doesn't work.
any suggestion?
$('input[name=cancella]').click(function(){ $(this) .closest('td') .find('input[name!='+this.name+']') .attr('disabled', false); });
fabrizio calderan .prevall()
way better. however, .siblings()
better, doesn't matter siblings are.
$('input[name=cancella]').click(function(){ $(this).siblings('input').attr('disabled', false); });
using .attr('disabled', false)
should work , more reliable.
Comments
Post a Comment