Add css class after the elements are created from a JS script
<p>I have a div</p>

<pre><code> &lt;div id="form"/&gt;
</code></pre>

<p>Some JS is building up a form from this div.</p>

<p>The result looks like</p>

<pre><code> &lt;div id="form"&gt; 
     &lt;fieldset&gt;
             ..inputs
     &lt;/fieldset&gt;
     &lt;fieldset&gt;
             ..inputs
     &lt;/fieldset&gt;
     &lt;fieldset&gt;
             ..inputs
     &lt;/fieldset&gt; 
 &lt;/div&gt;
</code></pre>

<p>Once the form has been build up I need to run this scripts</p>

<pre><code>$(":input","fieldset:eq(2)").addClass("readonly-form");
$(":input","fieldset:eq(2)").removeClass("txt_textarea");
</code></pre>

<p>The problem is when I put these scripts behind to code which is building up the form, the fieldset has not been build yet.</p>

<p>I cannot add attach a class to the fieldset in the JS code,which is building up the form.</p>

<p>Is there any way to wait until the form is build up and then add and remove the css ?</p>

<p>This isn't working</p>

<pre><code>  $(function(){
        var form = new Form("@Model.Name");
        form.AdditionalConfigUrlParams += "isshow=uloha"
        form.Create(@Html.Raw(Model.Data));

        $(":input","fieldset:eq(2)").addClass("readonly-form");
        $(":input","fieldset:eq(2)").removeClass("dhxlist_txt_textarea");

    });
</code></pre>
