jQuery create and submit form dynamically
<p>I'm trying to create and submit a form through code. What's wrong with the below?</p>

<pre><code>$('#btnPrintInvoicePerFile').on('click', function (event) {
    event.preventDefault(); //stop link default

    var componentInvoiceId = EberlsComponentInvoiceForm.componentInvoice.Id;
    console.log(componentInvoiceId);

    $('&lt;form&gt;', {
        "id": "getInvoiceImage",
        "html": '&lt;input type="text" id="componentInvoicId" name="componentInvoicId" value="' + componentInvoiceId + '" /&gt;',
        "action": window.siteRoot + 'ComponentInvoice/GetInvoiceImage/'
    }).submit();

});
</code></pre>
