Forum Moderators: open

Message Too Old, No Replies

Help for a function

         

gaucho

2:18 pm on May 24, 2005 (gmt 0)

10+ Year Member



Posted: Today at 9:13 am

Hi,

have actually the present code lines:

<a href="#" onclick="concatColumn(1);return false">Column 1</a>
<a href="#" onclick="concatColumn(2);return false">Column 2</a>
<a href="#" onclick="concatColumn(3);return false">Column 3</a>
<a href="#" onclick="concatColumn(4);return false">Column 4</a>

How I change this for:

<script>
function concatcols(){
for (i=0;i<cols.length[0].length;i++){
x=?
}
}
</script>

<a href="#" onclick="concatColumn(x);return false">All columns</a>
G.

orion_rus

1:59 pm on May 28, 2005 (gmt 0)

10+ Year Member



It's my solution:
<script>
function concatcols(){
table=document.getElementTagName('table');
for (i=0;i<table.childNodes.length;i++){
x+=table.childNodes[i].childNodes[0].innerHTML;
}
} //make sum from first td's in a each row
</script>
Good luck to you