Jquery remove divs already in page when adding data from AJAX response
<pre><code>jQuery.get("ajax.php", function(data)
    {
        prev = $("#newsfeed").html(); //Remember what was in the newsfeed
        $(data).find("div[id^='feed']").each(function() //Find every div starting with feed in AJAX response
            {
                alert('#' + $(this).attr("id")); //Works fine
                $('#' + $(this).attr("id")).remove(); //Remove any existing div with same id - Not working
             });
        $("#newsfeed").html(data + prev); //Append the AJAX response to the top of the page
    });
</code></pre>

<p>Please help, I'm relativly new to Jquery and don't have a clue what's going wrong.</p>
