cant return li id with jquery
<p>I am pulling in data through ajax to populate a facebook-like wall type application  (or a twitter wall).</p>

<p>But I'm getting undefined when i try to access the first li- if anyone can spot my obvious mistake it would be appreciated</p>

<pre><code>var get_venues = function(){

        $.ajax({
            type: "GET",
            url: '&lt;?=base_url()?&gt;wall/start_to_grab/',
            dataType: "JSON",
            success: function(data) {
                var sel = $("#wall");
                sel.empty();    

                for (var i=0; i &lt; data.length; i++) {

                  sel.append('&lt;li id="'+data[i].post_id +'"&gt; ' + data[i].title + '&lt;/li&gt;');

                }


            }
        });
        //start_poll($('ul#wall li:first').attr('id'));
        alert($("ul#wall li:first").attr("id")); // returns undefined
    };
</code></pre>

<p>The code returns undefined even when i can see the element on the page.</p>
