JQuery each not working as intended
<pre><code>    jQuery.get("ajax.php", function(data)
    {
        $(data).find("div[id^='feed']").each(function() //Find every div with id starting with feed in AJAX response
            {
                $('#' + $(this).attr("id")).remove();
            });
        $("#newsfeed").prepend(data);
    });
</code></pre>

<p>This works for some divs that fit this description in the ajax response, but not all. Thanks in advance.</p>

<p>Just to make it clear, I want to send out an AJAX request for HTML, itterate through all divs in the response. If they share an id with something already in the DOM AND the id starts with 'feed', remove them. Then append the AJAX to the top of newsfeed. Sorry if I didn't properly explain that before.</p>
