jQuery: I cannot modify an element's CSS color after using append()
<p>I have used jQuery's append() command to create a set of DIVs from an array.</p>

<p>After doing a simple JSON request, I would now like to change the color of the text within the DIV using the css() command. However, I cannot seem to get it to work.</p>

<p>Here is a cross-section of the code I have written:</p>

<pre><code>function createList(myArray){
    $.each(myArray,function(index,item){
        $("#results_panel").append('&lt;div id="result_'+item+'"&gt;'+item+'&lt;/div&gt;');
        doSomeStuff(item);
    });
}

function doSomeStuff(item){
    var urlJSON="file_upload.php?ip_address="+item;
    $.getJSON(urlJSON,function(json){
        if (json.result == "true") {
            $("#result_"+item).css("color","#00FF00");
        } else {
            $("#result_"+item).css("color","#FF0000");
        }
    });
}
</code></pre>

<p>If I use document.getElementByID.("result_"+item).style.color this will work, however.</p>

<p>Can anyone tell me what I am doing wrong here? I'm fairly new to jQuery, so apologies if this is a really obvious question.</p>
