I am having trouble hiding this page element with the id below in the html code
<table cellspacing=5 cellpadding=3>
<tr>
<td id="lst2"><h4>Apple Ipad for sale N70,000 (negotiable)</h4></td>
<td><a href="unibay.php" class="button edit">EDIT</a></td>
<td><a href="#" onclick="del('lst1');" class="button cross">DELETE</a></td>
</tr>
<tr id="lst2">
<td><h4>Apple Ipad for sale N70,000 (negotiable)</h4></td>
<td><a href="unibay.php" class="button edit">EDIT</a></td>
<td><a href="#" value="list2" onclick="del('lst1');" class="button">DELETE</a></td>
</tr>
</table>
I want to be able to hide the element with the selected id using jQuery called in a javascript function. Below is the code but its not working:
function del(obj) {
$(document).ready(function(){
var tdiv = document.getElementById(obj) ;
var sdiv = "#" + tdiv ;
$('.button').click(function () {
$(sdiv).fadeOut('slow');
});
});
}