Hi guys,
I'm trying to work on a form with jquery.
I have a table with 9 cells, 9 inputs and 9 delete links.
I want to delete de particular cell on which i've clicked delete, but cannot figure it out how.
I am able to delete the first element with value="1" but not the rest.
<table cellspacing="50">
<tr>
<td><input type="text" name="arr[]" value="1"><a id="del">Delete</a></td>
<td><input type="text" name="arr[]" value="2"><a id="del">Delete</a></td>
<td><input type="text" name="arr[]" value="3"><a id="del">Delete</a></td>
</tr>
<tr>
<td><input type="text" name="arr[]" value="4"><a id="del">Delete</a></td>
<td><input type="text" name="arr[]" value="5"><a id="del">Delete</a></td>
<td><input type="text" name="arr[]" value="6"><a id="del">Delete</a></td>
</tr>
<tr>
<td><input type="text" name="arr[]" value="7"><a id="del">Delete</a></td>
<td><input type="text" name="arr[]" value="8"><a id="del">Delete</a></td>
<td><input type="text" name="arr[]" value="9"><a id="del">Delete</a></td>
</tr>
</table>
jQuery(document).ready(function(){
$('td').hover(function(){
$(this).css("background-color","#E88914");
$(this).fadeOut(500);
$(this).fadeIn(function(){
$(this).css("background-color","#FFF");
});
});
$('#del').click(function(){
$(this).parent('td').remove();
})
});