Using jQuery: Wrapping div in another div with .before()
<p>I am trying to use jQuery to add a div around the following code:</p>

<pre><code>&lt;div class="fsSubField"&gt;
&lt;input id="field15744501-zip" class="fsField fsFieldZip fsFormatZipCA" type="text" value="" size="8" name="field15744501-zip"&gt;
&lt;br&gt;
&lt;label class="fsSupporting" for="field15744501-zip"&gt;Postal Code&lt;/label&gt;
&lt;/div&gt;
</code></pre>

<p>So that in the end I have:</p>

<pre><code>&lt;div class="fsSubFieldGroup" style="margin-top:5px;"&gt;
&lt;div class="fsSubField"&gt;
&lt;input id="field15744501-zip" class="fsField fsFieldZip fsFormatZipCA" type="text" value="" size="8" name="field15744501-zip"&gt;
&lt;br&gt;
&lt;label class="fsSupporting" for="field15744501-zip"&gt;Postal Code&lt;/label&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>I tried the following:</p>

<pre><code>$('input.fsFormatZipCA').parent().before('&lt;div&gt; class="fsSubFieldGroup" style="margin-top:5px;"&gt;');
$('input.fsFormatZipCA').parent().after('&lt;/div&gt;');
</code></pre>

<p>Because of the dynamic nature of the form I need to be able to base the select on 'input.fsFormatZipCA'</p>

<p>I would think this would work but the problem is that jQuery is doing the following:</p>

<pre><code>&lt;div class="fsSubFieldGroup" style="margin-top: 5px;"&gt;&lt;/div&gt;
&lt;div class="fsSubField"&gt;
&lt;input id="field15744501-zip" class="fsField fsFieldZip fsFormatZipCA" type="text" value="" size="8" name="field15744501-zip"&gt;
&lt;br&gt;
&lt;label class="fsSupporting" for="field15744501-zip"&gt;Postal Code&lt;/label&gt;
&lt;/div&gt;
</code></pre>
