Setting the value of an input within an html string returned via ajax
<p>I was wondering if there was a way to set the value of an input (returned via an ajax call) before appending it to the document.</p>

<pre><code> $(function () {
    $("#addItem").click(function () {
        var numRows = $('.row').length;
        $.ajax({
            url: this.href,
            cache: false,
            success: function (html) {
                // find input id in html that contains Order ?
                // set value of the input to numRows + 1 ?

                // append updated html to an element called #rows
                $("#rows").append(html);
            }
        });
        return false;
    });
</code></pre>

<p>Thanks for any help</p>

<p>Here's what the html might look like</p>

<pre><code>&lt;div class="row"&gt;
&lt;input type="hidden" name="OfficialAddresses.index" autocomplete="off" value="1cffe209-44e1-44ca-a013-a808bff8a174"&gt;
        &lt;fieldset&gt;
            &lt;legend&gt;Address&lt;/legend&gt;  
            &lt;div class="editor-field"&gt;
                &lt;input class="text-box single-line" id="OfficialOfficialAddresses_1cffe209-44e1-44ca-a013-a808bff8a174__Order" name="OfficialOfficialAddresses[1cffe209-44e1-44ca-a013-a808bff8a174].Order" type="text" value="0"&gt;

            &lt;/div&gt;
            &lt;div class="clear"&gt;&amp;amp;nsbp;&lt;/div&gt;
            &lt;a href="#" class="deleteRow"&gt;delete&lt;/a&gt;
            &lt;div class="clear"&gt;&amp;amp;nsbp;&lt;/div&gt;
        &lt;/fieldset&gt;
&lt;/div&gt;
</code></pre>
