deleting a list item <li> with jquery?

Ahilesik

New Member
im trying to delete a li item using jquery, but its not working heres my code?the html file:\[code\]<li> <a href="http://stackoverflow.com/questions/3744850/nano.com/$username"><img class="avatar" src="http://stackoverflow.com/questions/3744850/images/$picture" width="48" height="48" alt="avatar" /></a> <div class="tweetTxt"> <strong><a href="http://stackoverflow.com/questions/3744850/nano.com/$username">$username</a></strong> $auto <div class="date">$rel</div>$reply_info<div class="date"></div> <a class ="delbutton" href="http://stackoverflow.com/questions/3744850/#" id = $id> Delete </a> </div> <div class="clear"></div> </li>\[/code\]The jquery file:\[code\]$(function() {$(".delbutton").click(function(){var del_id = element.attr("id");var info = 'id=' + del_id;if(confirm("Sure you want to delete this update? There is NO undo!")){$.ajax({type: "POST",url: "delete.php",data: info,success: function(){}});$(this).parents(".record").animate({ backgroundColor: "#fbc7c7" }, "fast").animate({ opacity: "hide" }, "slow");}return false;});});\[/code\]the delete.php file:\[code\]<?phpinclude("includes/connect.php");if($_POST['id']){$id=$_POST['id'];$sql = "delete from {$prefix}notes where id='$id'";mysql_query( $sql);}?>\[/code\]
 
Back
Top