| Subject: | Simple Javascript rows change |
|---|---|
| From: | "ism" |
| Date: | Thu, 1 Jan 2009 07:28:16 +0000 UTC |
| Newsgroups: | macromedia.coldfusion.cfml_general_discussion |
Hi all-
I am trying to switch the row color of the clicked cell and tuen off the one
that is not clicked:
<script type="text/javascript">
var extra1 = 'off';
function toggleExtra1(s,c)
{
if(c== 'OffCels')
{
extra1 = 'on';
eval(s).className='OnCels';
}
else
{
eval(s).className='OffCels';
extra1 = 'off';
}
var extra1 = 'off';
}
</script>
<tr>
<td class="OffCels" id="r1"
onClick="toggleExtra1(this,this.className);">1</td>
</tr>
<tr>
<td class="OffCels" id="r2"
onClick="toggleExtra1(this,this.className);">2</td>
</tr>
</table>
Not sure why this is not working. It turns both on. thanks for help.
ISM
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Using variables on included files?, Steve Grosz |
|---|---|
| Next by Date: | Re: Using variables on included files?, Dan Bracuk |
| Previous by Thread: | Using variables on included files?, Steve Grosz |
| Next by Thread: | Re: Upload File in CFDIV, craigkaminsky |
| Indexes: | [Date] [Thread] [Top] [All Lists] |