jQuery selector for last created div element
<p>I have several divs that are generated dynamically after a file is uploaded. Each file upload creates a div in this format:</p>

<pre><code>&lt;div id="uploadifive-fileupload-queue" class="uploadifive-queue"&gt;
    &lt;div class="uploadifive-queue-item complete" id="uploadifive-fileupload-file-0"&gt;

        &lt;div id="inputs"&gt;

            some text

        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Every item uploaded increments the id of the uploadifive-queue-item class to uploadifive-fileupload-file-0, uploadifive-fileupload-file-1, uploadifive-fileupload-file-2, etc.</p>

<p>What I am trying to do is add a class to <code>#inputs</code>, but only the one just created.</p>

<p>I've tried the following, but it applies the class to the wrong div (usually the first div)</p>

<pre><code>  $('#fileupload').uploadifive({
                'buttonClass'  : 'btn btn-primary',
                'buttonText'   : 'Select Thumbnail',
                'dnd' : false,
                'fileSizeLimit' : 1000,
                'method' : 'post',
                'simUploadLimit' : 1,
                'uploadScript' : './upload/',
                'onUploadComplete'  : function(file, data) {
                    $('#inputs:last').addClass('alert-error');
                }

            });
</code></pre>

<p><code>#fileupload</code> is just the name of the form, here's the HTML:</p>

<pre><code>&lt;form id="fileupload"&gt;
    &lt;input type="file" name="userfile" size="20" /&gt;
&lt;/form&gt;
</code></pre>

<p>The divs are added directly underneath and are inside the same container.</p>

<p>How can I select the correct div? </p>
