title: In Firefox insertRow() is not working in javascript
body: <p>I am working in a JSP file. In that I need to create one table with multiple rows onclick event. When I am trying the following code in IE7 and IE8, it is working fine. But when I am trying the same in Firefox[ (in any version) it is not creating the table. </p>
  
  <p>This is the div part I need to create ,</p>
  
  <pre><code>&lt;div id="acc" style="display:none" width="90%"&gt;
      &lt;table border=0 cellpadding=1 cellspacing=1 width="97%" align="center"&gt;
          &lt;tr&gt;
              &lt;td class="txnSubHdrBg"&gt;
                  &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
                      &lt;tr&gt;
                          &lt;td nowrap&gt;Account Details&lt;/td&gt;
                          &lt;td align="right"&gt;
                          &lt;table border="0" cellspacing="0" cellpadding="0"&gt;
                            &lt;tr&gt;                            
                              &lt;td style="padding-right:2px;" valign="top"&gt;&lt;a href="javascript:void(0)"&gt;&lt;img src="/images/add_account_but.jpg" border="0"  alt="Add account credit details" onclick="return addAccountRow(); return false;"/&gt;&lt;/a&gt;&lt;/td&gt;
                            &lt;/tr&gt;
                          &lt;/table&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;                            
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;% int rowId=0;%&gt;
      &lt;table border=0 cellpadding=1 cellspacing=1 width="97%" id="AccountList" align="center" &gt; 
          &lt;logic:iterate name="xMBeneficiaryRegistrationForm"  property="beneficiaryAccountList" id="row"&gt;                            
              &lt;tr&gt;&lt;td&gt;
                  &lt;table cellpadding=0 cellspacing=6 width="100%"&gt;
                  &lt;tr&gt;
  
                      &lt;html:hidden name="row" property="accountSerialNo"/&gt;
                      &lt;td class="fieldLabel" width="180"&gt;&lt;bean:message key="XpressMoney.Xpress.AccountName"/&gt;&lt;/td&gt;
                      &lt;td class="fldtxt"&gt;
                          &lt;html:text name="row"  property="accountName" styleClass="fieldText" size="20"  tabindex="27" style="width:167px" title="Input Account Name" onkeypress="return AcceptableCharsforAddress(event); return false;"/&gt;
                          &lt;span class="fieldLabel" &gt;&lt;bean:message key="label.mamStatus"/&gt;&lt;/span&gt;
                          &lt;html:select property="accountStatusDisplay" tabindex="28" styleClass="fieldText" size="1"&gt;
                          &lt;html:option value="1"&gt;&lt;bean:message key="XpressMoney.XM.Enable"/&gt;&lt;/html:option&gt;
                          &lt;html:option value="1073741824"&gt;&lt;bean:message key="XpressMoney.XM.Disable"/&gt;&lt;/html:option&gt;
                          &lt;/html:select&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td class="fieldLabel"&gt;&lt;bean:message key="XpressMoney.Xpress.AccountNo"/&gt;&lt;/td&gt;
                      &lt;td class="fldtxt"&gt;
                          &lt;html:text name="row"  property="accountNo" tabindex="29" styleClass="fieldText" onkeypress="return AcceptCharsandNumbers(event)" style="width:167px;padding:0 0 0 3px"  size="20" title="Input Account No"/&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;                                   
                  &lt;tr&gt;
                      &lt;td align="left" class="fieldLabel"&gt;Bank Name&lt;/td&gt;
                      &lt;td class="fldtxt"&gt; 
                      &lt;input type="hidden" name="beneficiaryBankTemp" value=&lt;bean:write name="row"  property="beneficiaryBank"/&gt;&gt;
                      &lt;select class="fieldText" style="width:250px" name="beneficiaryBank" onchange="retrieveDestinationBeneficiaryBankName(&lt;%=rowId%&gt;)" &gt;
                           &lt;option value="0"&gt;--select Bank--&lt;/option&gt;
                      &lt;/select&gt;   
                      &lt;/td&gt;
                  &lt;/tr&gt;                           
                  &lt;tr&gt;
                      &lt;td align="left" class="fieldLabel"&gt;Beneficiary Bank&lt;/font&gt;&lt;/td&gt;
                      &lt;td class="fldtxt"&gt; 
                      &lt;input type="hidden" name="beneficiaryBankNameTemp" value=&lt;bean:write name="row"  property="beneficiaryBankName"/&gt;&gt;                                         
                      &lt;select class="fieldText" style="width:250px" name="beneficiaryBankName" onchange="setSelectedBankValuesToHidden();"&gt;
                           &lt;option value="0"&gt;--select Beneficiary Bank--&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;/td&gt;
  
                  &lt;/tr&gt;                   
  
  
                  &lt;/table&gt;
              &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/logic:iterate&gt;                
      &lt;/table&gt;
      &lt;%rowId++;%&gt;
  </code></pre>
  
  <p></p>
  
  <p>The function which I have for <code>addrows</code> is,</p>
  
  <pre><code>function addAccountRow()
  {
      var AccountListTable = document.getElementById('AccountList');
      receivingAgentCodeIndex = AccountListTable.rows.length; 
          var countryBankHTML = "&lt;input type ='hidden' name='beneficiaryBankTemp' value=''/&gt;&lt;select class='fieldText' name='beneficiaryBank' id='beneficiaryBank'"+receivingAgentCodeIndex+"' onchange='return retrieveDestinationBeneficiaryBankName("+receivingAgentCodeIndex+"); return false;'  style='background-color:#FFFFFF;width:250px' maxlength='60'  &gt;&lt;option value='0'&gt;---Select Bank---&lt;/option&gt;&lt;/select&gt;"
          var countryBeneficiaryBankHTML = "&lt;input type ='hidden' name='beneficiaryBankNameTemp' value=''/&gt;&lt;select class='fieldText' name='beneficiaryBankName' id='beneficiaryBankName'"+receivingAgentCodeIndex+"' onchange='setSelectedBankValuesToHidden();'  style='background-color:#FFFFFF;width:250px'  maxlength='30' &lt;option value='0'&gt;---Select Beneficiary Bank---&lt;/option&gt;&lt;/select&gt;" ;
  
      var index = AccountListTable.rows.length;   
      if (validateAccountFields(index))
      {
          var AccountListTableRow = AccountListTable.insertRow();
          AccountListTableRow.setAttribute("id",index); 
  
  
          var AccountFieldsHTM1 =" &lt;table border=0 cellpadding=0 cellspacing=5 width='100%' id='AccountList1' style='padding:0 0 0 0'&gt;&lt;tr&gt;&lt;input type ='hidden' name='accountSerialNo'/&gt;"+
                  "&lt;td class='fieldLabel' width='181'&gt;&lt;bean:message key='XpressMoney.Xpress.AccountName'/&gt;&lt;/td&gt;"+
                  "&lt;td class='fldtxt'&gt;&lt;input type='text' name='accountName' class='fieldText' size='20'  style='width:167px' title='Input Account Name' onkeypress='return AcceptableCharsforAddress(event); return false;'/&gt;"+
                  "&amp;nbsp;&lt;span class='fieldLabel'&gt;&lt;bean:message key='label.mamStatus'/&gt;&lt;/span&gt;"+
                  "&lt;select name='accountStatusDisplay' class='fieldText' size='1'&gt;&lt;option value='1' selected&gt;&lt;bean:message key='XpressMoney.XM.Enable'/&gt;&lt;/option&gt;&lt;option value='1073741824'&gt;&lt;bean:message key='XpressMoney.XM.Disable'/&gt;&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;"+
                  "&lt;tr&gt;&lt;td class='fieldLabel'&gt;&lt;bean:message key='XpressMoney.Xpress.AccountNo'/&gt;&lt;/td&gt;"+
                  "&lt;td class='fldtxt'&gt;&lt;input type='text' name='accountNo' class='fieldText' onkeypress='return AcceptCharsandNumbers(event)'  size='20' style='width:167px' title='Input Account No'/&gt;&lt;/td&gt;&lt;/tr&gt;"     
                  + "&lt;tr&gt;&lt;td class='fieldLabel'  &gt;Bank Name&lt;/td&gt;&lt;td class='fldtxt' &gt;"+countryBankHTML+"&lt;/td&gt;&lt;/tr&gt;"
                  + "&lt;tr&gt;&lt;td class='fieldLabel'  &gt;Beneficiary Bank&lt;/td&gt;&lt;td class='fldtxt' &gt;"+countryBeneficiaryBankHTML+"&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;"
  
  
  
  
  
          var AccountCredit = AccountListTableRow.insertCell();
          AccountCredit.insertAdjacentHTML('afterBegin',AccountFieldsHTM1);
          retrieveDestinationCountryDetailsV1(receivingAgentCodeIndex); 
      }
  }
  </code></pre>
  
  <p>How can I make it Firefox compatible?</p>