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

getting cell contents

P: 2
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
Aug 29 '06 #1
Share this Question
Share on Google+
2 Replies


iam_clint
Expert 100+
P: 1,208
uhm i believe you can set an id for each TD and then use javascript to get the innerHTML of that td...

document.getElementById('parent1').innerHTML
document.getElementById('child1').innerHTML
Aug 29 '06 #2

P: 8
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.
Dec 8 '06 #3

Post your reply

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