jQuery: children count = 0 and ajax
<p>I'm working on a jQuery that gets a list of elements from a server, appends it to an element, and then loops in the newly appended elements to transform them (make them jEditable).</p>

<p>I'm having trouble with the loop. The appending works alright, so I have a list of elements like :</p>

<pre><code>&lt;div id="innerModal"&gt;
    &lt;label id="exampleTitle"&gt;Title :&lt;/label&gt;
    &lt;label id="exampleField" class="ftext"&gt;Value&lt;/label&gt;
&lt;/div&gt;
</code></pre>

<p>Then I try to loop in: </p>

<pre><code>function makeListEditable(element, type){
    //I checked here that the element sent is well '#innerModal'
    alert($(element).children().length);
    $(element).children().each(function() {

        if( $( this ).is( 'ftext' ) ){
            makeEditable( $( this ), type, '', '' );
        }
    });
}
</code></pre>

<p>The alert prints "0".</p>

<p>Where does that issue come from? How can I fix it?</p>

<p>Edit : Here's the call of makeListEditable : </p>

<pre><code>getFormOnElement(//Gets the form and appends it
    "getorganisationeditable/"+curOId,
                        "#innerModal"
    );
    makeListEditable('#innerModal');
</code></pre>

<p>Thanks in advance!</p>
