Answer: <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function() {
$('input[type="button"]').click(function(e) {
var row = $(this).closest('tr');
row.remove()
})
})
</script>
<div>
<table>
<tr>
<td><input type="button" value="Delete Row1"/></td>
</tr>
<tr>
<td><input type="button" value="Delete Row2" /></td>
</tr>
<tr>
<td><input type="button" value="Delete Row3"/></td>
</tr>
</table>
</div>
Asked In: Many Interviews |
Alert Moderator