Why is clone only cloning item once?
<p>I'm new to jquery and I'm 100% sure I'm making a logical error but I can't see it. Basically as a user types a item in a field I want to clone the fields so they can continue adding more info.  In the example I'm working on, I'm trying to create a list of siblings and their age.</p>

<p>Here's my code:</p>

<pre><code>$(document).ready(function () {
    $("input[name='age']").on('keydown', function() {
    //is it the last input?
    if (this == $("input[name='age']:last", this.form)[0]) {
        //insert an empty clone of the current input
        //$(this).after($(this).clone(true).val(''));
        $('.family').clone().insertAfter(".family");
    }
</code></pre>

<p>Here's the html:</p>

<pre><code>&lt;form&gt;
&lt;div class="family"&gt;
    &lt;input name="age" value=0&gt;  &lt;input name="sibling" value="name?"&gt;
    &lt;hr /&gt;
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>If I use <code>$(this).after($(this).clone(true).val(''));</code> then it works but it only clones one field(the age one) so I tried to replace it with <code>$('.family').clone().insertAfter(".family");</code> to clone the div class but it clones the fields only once.  If I start typing my first siblings info then the second form will appear but if I start typing on the second form then nothing new appears after that.</p>

<p>Its just a guess but I think the if statement is not matching so the clone isn't being created(I'm new so this idea could be wrong).  If this is the case then I'm confused because I'm cloning the same names of the input fields so <code>input[name='age']:last</code> should match the last age field..not sure.</p>

<p>Any idea what I'm doing wrong?</p>
