Generate form dynamically and submit it by jquery
<p>i was searching google just to have way out to generate &amp; submit form by jquery and i found code snippet but few things was not clear to me.</p>

<pre><code>function submitValues(url, params) {
var form = [ '&lt;form method="POST" action="', url, '"&gt;' ];

for(var key in params) 
    form.push('&lt;input type="hidden" name="', key, '" value="', params[key], '"/&gt;');

form.push('&lt;/form&gt;');

jQuery(form.join('')).appendTo('body')[0].submit();
}
</code></pre>

<p>why [] this third bracket is used like </p>

<pre><code>var form = [ '&lt;form method="POST" action="', url, '"&gt;' ];
</code></pre>

<p>what is the meaning of the line <strong>jQuery(form.join('')).appendTo('body')[0].submit();</strong>
why <strong>form.join('')</strong> has been used and why write like <strong>appendTo('body')[0]</strong> why <strong>[0]</strong></p>

<p>please guide me in detail for those above bold syntax. thanks</p>
