posted 17 years ago
I downloaded some code with CSS involved, when a table cell is clicked, the corresonding row and column are highlighted. the way to highlight is defined in CSS, suppose row highlight is assigned with classname: 'rowL' and column highlight is assigned with classname: 'colL'.
The intersection is defined as .rowL .colL {....}, so in the JavaScript, it highlights a row first (using row classname), then use a loop to highlight the column (using column classname), then the intersection table cell has two attributes at the same time.
I want to use CSS classname to determine the table cell value, but I have no idea to write if statement, I tried
if(cellattr.className == 'rowL' && cellattr.className == 'colL' )
if(cellattr.className == 'rowL && colL')
But none of them works.
Please help. Thanks.
SCJA, SCJP5.0, SCBCD, SCWCD