I am actually making a unlike button for my website.
The code I’ve used so far-
$(".unlike").click(function(){
var pid = $(this).attr("id");
var email = $("#hidden").val();
var data = "pid="+pid+"&email="+email;
$("#flash").show();
$("#flash").fadeIn(500).html('<img src="wamp.gif" /> Loading...');
$.ajax({
type: "POST",
url: "unlike.php",
data: data,
cache: false,
success: function(html) {
$("#flash").fadeOut(100);
$("#likes"+id).text(html).replaceWith('');
}
});
});
This code is what happens on the click of the unlike button.
It sends data to the unlike.php file where it removes the person’s name from the likes table, and what i want is that it should also remove the name from the tag
Try this.