Acces to TD in array on html document ?

M

Moi

Hi,

I have a 'small' problem for read and write something in TD cell

i try this:

d = window.document;

eTBL = d.getElementById('tbCal');
cTR = eTBL.getElementsByTagName('td');

cTD = new Array(); // Collection des TD ligne par ligne
for (i = 0; i < cTR.length; i++){
cTD = cTR.getElementsByTagName('td');
alert("une cellule");
}

but if eTBL is correct...... cTR.length = 0

why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for each,
but the first line have only 3 cell


HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
V

Vjekoslav Begovic

Moi said:
Hi,

I have a 'small' problem for read and write something in TD cell

i try this:

d = window.document;

eTBL = d.getElementById('tbCal');
cTR = eTBL.getElementsByTagName('td');

Shouldn't be cTR = eTBL.getElementsByTagName('tr'); ?

^^^
cTD = new Array(); // Collection des TD ligne par ligne
for (i = 0; i < cTR.length; i++){
cTD = cTR.getElementsByTagName('td');
alert("une cellule");
}

but if eTBL is correct...... cTR.length = 0

why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for each,
but the first line have only 3 cell


HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top