How to make this code work? I don't see how i can reach div from within $.get callback.
$("<div/>", {
text: "some text",
click: function (e) {
$.get("bar.php", function(data) {
$(this).text(data); // doesn't work
});
}
}).appendTo("body");