By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,399 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,399 IT Pros & Developers. It's quick & easy.

Table Row innerHTML

P: 31
Hello,

I have an table, and i want to update whole row dynamically, according the user entered data......
below is the example,

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <script type="text/javascript">
  3. function doThis()
  4. {
  5.     var strart_td ="<TD>";
  6.     var close_td  = "</TD>";
  7.     var str_value = '';
  8.  
  9.         str_value = str_value + strart_td + document.getElementById('txt1').value + close_td;
  10.  
  11.     document.getElementById('id_table').rows[0].innerHTML = str_value;
  12. }
  13. </script>
  14. </head>
  15.  
  16. <body>
  17.         <div style="float:left;">
  18.         <input type="text" id="txt1" value="">
  19.         <input type="text" id="txt2" value="">
  20.         <input type="button" onClick="javascript:doThis();" value="Click Me to change the values of Table">
  21.         </div>
  22.         <div style="float:right;">
  23.         <table border="1" id="id_table">
  24.         <tr id="row1">
  25.             <td width="100">1</td>
  26.             <td width="100">2</td>
  27.         </tr>
  28.         <tr>
  29.             <td width="100">1</td>
  30.             <td width="100">2</td>
  31.         </tr>
  32.         </table>
  33.         </div>
  34. </body>
  35. </html>

The above script works fine in Firefox, but its not working in IE 6,
can somebody help me out.........!!!

Thanks in advance........!!!
Dec 30 '09 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Do you get an error in IE6? Have you tried other versions of IE?
Dec 30 '09 #2

Post your reply

Sign in to post your reply or Sign up for a free account.