With this function I want to submit data (res_id) to a script and fadeout the div by it’s id (using variable pos), the script is executed but the div won’t fade out. Why is that?
$('.remove_resort').click(function() {
pos = $(this).attr("id");
rem_res();
});
function rem_res() {
$.get("/snowreport/request/remove.php", {
res_id: pos
}, function(data1) {
pos.fadeOut("slow");
});
}
poscontains the ID string, so you need$("#" + pos).fadeOut("slow")