why this javascript function is not executing, no error in console
<p>This function is a problem:</p>

<pre><code>function addInvoiceItemValue(name,pkwiu,netto,unit,qty,vat) {

if(vat == '23') v23 = " selected='selected'";
if(vat == '22') v22 = " selected='selected'";
if(vat == '8') v8 = " selected='selected'";
if(vat == '7') v7 = " selected='selected'";
if(vat == '5') v5 = " selected='selected'";
if(vat == '3') v3 = " selected='selected'";
if(vat == '0') v0 = " selected='selected'";
if(vat == 'zw') vzw = " selected='selected'";

var vatSelect = "&lt;option value='23'"+v23+"&gt;23%&lt;/option&gt;&lt;option value='22'"+v22+"&gt;22%&lt;/option&gt;&lt;option value='8'"+v8+"&gt;8%&lt;/option&gt;&lt;option value='7'"+v7+"&gt;7%&lt;/option&gt;&lt;option value='5'"+v5+"&gt;5%&lt;/option&gt;&lt;option value='3'"+v3+"&gt;3%&lt;/option&gt;&lt;option value='0'"+v0+"&gt;0%&lt;/option&gt;&lt;option value='zw'"+vzw+"&gt;zw.&lt;/option&gt;";
var row = "&lt;tr id='item" + itemID + "'&gt;&lt;td&gt;&lt;input size='30' maxlength='300' id='ii-name-" + itemID + "' name='ii-name-" + itemID + "' value='" + name + "'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='6'  maxlength='50' id='ii-pkwiu-" + itemID + "' name='ii-pkwiu-" + itemID + "' value='"+pkwiu+"'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='6'  maxlength='16' id='ii-netto-" + itemID + "' name='ii-netto-" + itemID + "' value='"+netto+"'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='5'  maxlength='128' id='ii-unit-" + itemID + "' name='ii-unit-" + itemID + "' value='"+unit+"'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='5'  maxlength='6' id='ii-qty-" + itemID + "' name='ii-qty-" + itemID + "' value='"+qty+"'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;select id='ii-vat-" + itemID + "' name='ii-vat-" + itemID + "'&gt;" + vatSelect + "&lt;/select&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;a onclick='delInvoiceItem(\"item" + itemID + "\")'&gt;&lt;b&gt;-&lt;/b&gt; Usuń&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;";

$('#invoiceItems tr:last').after(row);

itemID++;
}
</code></pre>

<p>Example execution:</p>

<pre><code>addInvoiceItemValue('yyy','','676.76','','1','23');
addInvoiceItemValue('fgh','','777.00','','1','8');
</code></pre>

<p>And here is function that work's fine:</p>

<pre><code>function addInvoiceItem() {

var vatSelect = "&lt;option value='23'&gt;23%&lt;/option&gt;&lt;option value='22'&gt;22%&lt;/option&gt;&lt;option value='8'&gt;8%&lt;/option&gt;&lt;option value='7'&gt;7%&lt;/option&gt;&lt;option value='5'&gt;5%&lt;/option&gt;&lt;option value='3'&gt;3%&lt;/option&gt;&lt;option value='0'&gt;0%&lt;/option&gt;&lt;option value='zw'&gt;zw.&lt;/option&gt;";
var row = "&lt;tr id='item" + itemID + "'&gt;&lt;td&gt;&lt;input size='30' maxlength='300' id='ii-name-" + itemID + "' name='ii-name-" + itemID + "' value=''&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='6'  maxlength='50' id='ii-pkwiu-" + itemID + "' name='ii-pkwiu-" + itemID + "' value=''&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='6'  maxlength='16' id='ii-netto-" + itemID + "' name='ii-netto-" + itemID + "' value='0'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='5'  maxlength='128' id='ii-unit-" + itemID + "' name='ii-unit-" + itemID + "' value=''&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;input size='5'  maxlength='6' id='ii-qty-" + itemID + "' name='ii-qty-" + itemID + "' value='1'&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;select id='ii-vat-" + itemID + "' name='ii-vat-" + itemID + "'&gt;" + vatSelect + "&lt;/select&gt;&lt;/td&gt;";
row += "&lt;td&gt;&lt;a onclick='delInvoiceItem(\"item" + itemID + "\")'&gt;&lt;b&gt;-&lt;/b&gt; Usuń&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;";

$('#invoiceItems tr:last').after(row);

itemID++;
}
</code></pre>
