getting cell contents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pricter
    New Member
    • Aug 2006
    • 2

    getting cell contents

    Is there a way to get the cell content of a table?
    For example if I have the below table

    Parent | Child
    Mark | Nick
    Julia | Maria

    Is there a way to get the contents for example below the table to have a sentence of Mark is the parent of Nick
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    uhm i believe you can set an id for each TD and then use javascript to get the innerHTML of that td...

    document.getEle mentById('paren t1').innerHTML
    document.getEle mentById('child 1').innerHTML

    Comment

    • Johny Rodriguez
      New Member
      • Dec 2006
      • 8

      #3
      You can deffinately get the contents using innerHTML with javascript if the cell has an id, however if the cell was generated and inserted dynamically, , and does not have an id you won't be able to get the contents using innerHTML. A solution for getting the contents using row and cell indices, which you can loop through, would be ideal if anyone out there has one.

      Comment

      Working...