How do I increment attributes with numbers using jquery?
<p>I have a HTML snippet as follows, I want to take the 'article-form' div, clone it, and increment the numbers for the attributes <em>for</em>, <em>id</em>, and <em>name</em>.</p>

<pre><code>&lt;div class="article-form"&gt;
    &lt;label for="id_form-0-section"&gt;Section:&lt;/label&gt;
    &lt;select id="id_form-0-section" name="form-0-section"&gt;
        &lt;option selected="selected" value=""&gt;---------&lt;/option&gt;
        &lt;option value="1"&gt;News&lt;/option&gt;
        &lt;option value="2"&gt;Originals&lt;/option&gt;
    &lt;/select&gt;
    &lt;label for="id_form-0-slug"&gt;Slug:&lt;/label&gt;
    &lt;input type="text" maxlength="255" name="form-0-slug" id="id_form-0-slug"&gt;
    &lt;input type="hidden" id="id_form-0-collection" name="form-0-collection"&gt;
    &lt;input type="hidden" id="id_form-0-order" name="form-0-order"&gt;
    &lt;input type="hidden" id="id_form-0-id" name="form-0-id"&gt;
&lt;/div&gt;
</code></pre>

<p>I have the cloning part so far, but I need to take what I have cloned an traverse the elements inside have the attribute <em>for</em>, <em>id</em>, and <em>name</em>.</p>

<pre><code>var $articeForm = $('.article-form').clone();
</code></pre>

<p>Let me add, the increment part isn't the problem. I plan on doing the following. I am not sure what is the best way to traverse by attribute.</p>

<pre><code>var newNumber = parseInt($('#id_form-0-id').attr('id').split('-')[1]) + 1;
</code></pre>

<p>One more thing, the fact that this started at 0 is meaningless, in some situations it could start with 5 and then the next fields that follow should be 6.</p>
