Results 1 to 2 of 2

Thread: getElementById properties

  1. #1
    Join Date
    Sep 2010
    Posts
    38

    getElementById properties

    I am trying to change the value of a table cell in JavaScript using the getElementById method. The cell has a defined id and a value in it.

    Like in this example , a table with one column and two rows.

    Code:
    <table width="100%" border="0" align="left" cellpadding="0" cellspacing="0" class="" bgcolor="#D6D6D6">
      <tr>
    <td width="8.3%">Jan</td>
      </tr>
      <tr>
    <td width="8.3%" align="center" id="jan">0</td>
       </tr>
    </table>
    If I try to assign a value to getElementById(['jan']).value, it looks like I am using the wrong property.

    What is the correct property to access and change the value "0" in the second cell of my table?

  2. #2
    Join Date
    Sep 2010
    Posts
    38
    I figured it out.

    .innerHTML

    Thanks.

Similar Threads

  1. file properties
    By spasticus in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 22 Mar 2007, 01:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •