I have the following html
<tr class="editorRow">
<td class="emailRow">
<input id="EmailSuccessList_0"
name="EmailSuccessList[0]"
type="text" value="asdf@lib.com">
</td>
<td>
<button type="button" href="#"
class="deleteEmailRow button sexybutton "
name="asdf@lib.com">delete</button>
</td>
</tr>
I have the following Jquery (whcih works) and need some help with the selectors and/or methods to access/change the name of the button base on user input. It seems very clunky to me.
$('.emailRow input').live('keyup', function (e) {
var target = this;
var currentVal = $(this).val();
$(target).parent().parent().find('button').attr('name', currentVal)
});
This is the best I have come up with so far after some Jquery API searching..