By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,400 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

how to change a cell's border colour onClick?

P: n/a
ms
Hi, I've been trying to find a way to change a cell's colour when clicking it.
What I've found so far is to change the background colour by using:
function whenClick(navElm) {
var state1 = '#0000FF';
if(navElm.style.backgroundcolor != state1){
navElm.style.backgroundcolor = state1;
}
}

My problem is, first it does not work when I used <td bgcolor="#00FFFF" id ="s2"
onclick ="whenClick(this)">&nbsp;</td>; second, what I want is to change the
border colour. Could anyone please help me on that?
Thanks a lot!
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"ms" <s4******@student.uq.edu.au> wrote in message
news:d2***********@bunyip2.cc.uq.edu.au...
Hi, I've been trying to find a way to change a cell's colour when clicking it. What I've found so far is to change the background colour by using:
function whenClick(navElm) {
var state1 = '#0000FF';
if(navElm.style.backgroundcolor != state1){
navElm.style.backgroundcolor = state1;
}
}

My problem is, first it does not work when I used <td bgcolor="#00FFFF" id ="s2" onclick ="whenClick(this)">&nbsp;</td>; second, what I want is to change the border colour. Could anyone please help me on that?
Thanks a lot!


"backgroundColor" not "backgroundcolor".

and

"borderColor" not "bordercolor".
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.