Store jQuery objects in an array/object
<p>I want to create a JS array that contains jQuery objects like this:</p>

<pre><code>var oFormFields = new Object;
oFormFields.label = $(document.createElement('label'));
oFormFields.input = $(document.createElement('input'));
</code></pre>

<p>Since this crashes my code, i expect this is not possible. Any alternatives? This is my simplified version, I want to include some other properties so I'm able to re-use this in my code when building dynamic forms.</p>

<p>EDIT: Seemed this did work after all... what I wanted to do, was something like this:</p>

<pre><code>var oFormFields = new Object;
oFormFields.name_field.label = $(document.createElement('label')).addClass('nam_field');
oFormFields.name_field.input = $(document.createElement('input')).addClass('nam_field');
</code></pre>

<p>This does break my code. I'm pretty new to jQuery, coming from a PHP background I'm having some troubles adjusting to the correct way to work with arrays / objects.</p>
