|
-
Jul 19th, 2003, 07:58 AM
#1
Thread Starter
Hyperactive Member
Setting a table cell's style?
Can anyone tell me why this bit of code just doesnt work please? 
Code:
function showtab(show,count){
for(c=1;c<count+1;c++){
if(show==c){
document.getElementById('tabcell' + c).style='tabselected';
}else{
document.getElementById('tabcell' + c).style='tabunselected';
}
}
}
All i'm trying to do is change the style of a cell when it gets clicked, the event fires but vstudio blows up on me.
any ideas?
Last edited by tailz; Jul 19th, 2003 at 08:02 AM.
-
Jul 19th, 2003, 08:02 AM
#2
Thread Starter
Hyperactive Member
the html table looks like this:
<TABLE id="tblTabs" cellSpacing="4" cellPadding="3" width="100%" border="0">
<TR>
<TD id="tabcell1" noWrap align="middle" width="20%" class="tabselected">
<a id="_ctl0_HyperLink2" href="javascript:showtab(1,3)">Image tab1 caption</a></TD>
<TD id="tabcell2" noWrap align="middle" width="20%" class="tabunselected">
<a id="_ctl0_HyperLink3" href="javascript:showtab(2,3)">tab 2 caption</a></TD>
<TD id="tabcell3" noWrap align="middle" width="20%" class="tabunselected">
<a id="_ctl0_HyperLink4" href="javascript:showtab(3,3)">tab 3 caption</a></TD>
</TR>
</TABLE>
-
Jul 19th, 2003, 08:25 AM
#3
Thread Starter
Hyperactive Member
nevermind sorted it, using wrong property :]
Code:
document.getElementById('tabcell' + c).className='tabselected';
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|