Jquery 为什么<;tr>;单击“否”按钮时是否未删除?

Jquery 为什么<;tr>;单击“否”按钮时是否未删除?,jquery,Jquery,代码怎么了 $('<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();})

代码怎么了

$('<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();})
$(“”)
.appendTo('表')
.find('input[type=text]”)
.选择()
(完)
.find(“输入[type='text'][value='No']”)
.click(function(){$(this).parents('tr').remove();})

您正在选择选择器上的type=text。将其更改为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();})
$(“”)
.appendTo('表')
.find('input[type=button]”)
.选择()
(完)
.find(“输入[type='button'][value='No']”)
.click(function(){$(this).parents('tr').remove();})

这不应该是
输入[type='button']
?虽然我看不出第二次查找、选择或结束的原因……他将其附加到一个表中,因此它可能实际存在