Reputation: 63646
What's wrong with the code?
$('<tr><td><input type="button" value="No" /></td></tr>')
.appendTo('table')
.find('input[type=text]')
.select()
.end()
.find("input[type='text'][value='No']")
.click(function() {$(this).parents('tr').remove();})
Upvotes: 0
Views: 63
Reputation: 48088
You're selecting type=text at your selectors. Change them to type=button.
$('<tr><td><input type="button" value="No" /></td></tr>')
.appendTo('table')
.find('input[type=button]')
.select()
.end()
.find("input[type='button'][value='No']")
.click(function() {$(this).parents('tr').remove();})
Upvotes: 2