vinodh_v_p
06-11-2008, 11:58 AM
I am totally new to javascript.Please help me resolve the following javascript problem.I am having a table which has 10 rows.Each row has 3 td's.
While loading the page I want to assign two different css classes to these table rows alternatively.That is for the first row "class1" second row "class2", third row again "class1" 4ht row "class2" and so on.But the problem i am facing is that in these rows,some of the rows i will be hiding and showing depending on values in some td's.
ie.for example 4th row contains a drop down box.So if the user selects a particular value from the drop down box , I will show or hide the 5 th row.I am able to hide and show the tr's.But then the classses assigned to each row alternatively breaks down.When i hide 5th row, then 4th row and 6 th rows are having the same classes.I want 5th row as "class1" and 6 th row as "class2" when 5th row is "hidden".But when 5 th row is displayed 4t row should have "class1" 5th row "class2" 6 th row "class1" etc..
Can any body give me code for getting the tr's from the table and assign classes to these tr's dynamically?
While loading the page I want to assign two different css classes to these table rows alternatively.That is for the first row "class1" second row "class2", third row again "class1" 4ht row "class2" and so on.But the problem i am facing is that in these rows,some of the rows i will be hiding and showing depending on values in some td's.
ie.for example 4th row contains a drop down box.So if the user selects a particular value from the drop down box , I will show or hide the 5 th row.I am able to hide and show the tr's.But then the classses assigned to each row alternatively breaks down.When i hide 5th row, then 4th row and 6 th rows are having the same classes.I want 5th row as "class1" and 6 th row as "class2" when 5th row is "hidden".But when 5 th row is displayed 4t row should have "class1" 5th row "class2" 6 th row "class1" etc..
Can any body give me code for getting the tr's from the table and assign classes to these tr's dynamically?