firefox add new row problem

Add new row fails in firefox. works in ie 6.
in firefox when i click on "add row"  it doesnt do anything.

pl help

here is the code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
<SCRIPT LANGUAGE="JavaScript">
<!--
function addRow() {

      var x=document.getElementById('t1').insertRow();
      var col1=x.insertCell(0);
      var col2=x.insertCell(1);
      col1.innerHTML="232";
      col2.innerHTML="3232"

}
//-->
</SCRIPT>
 </HEAD>
 <BODY>
  <TABLE id="t1">
        <TR>
            <TD>1</TD>
            <TD>2</TD>
        </TR>
        <TR>
            <TD>11</TD>
            <TD>22</TD>
        </TR>
  </TABLE>
  <INPUT TYPE="button" value="add row" onclick="addRow()">
 </BODY>
</HTML>
vidhubalaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
HonorGodConnect With a Mentor Commented:
You need to specify the row # of the row to be added/inserted...
For example:

var x = document.getElementById( 't1' ).insertRow( 2 );
0
 
HonorGodCommented:
You might want to take a look at:

http://www.experts-exchange.com/Q_22933336.html

0
 
vidhubalaAuthor Commented:
works cool.. thanks.
0
 
HonorGodCommented:
You are very welcome.
Thanks for the grade & points.
Good luck
0
All Courses

From novice to tech pro — start learning today.