472,988 Members | 2,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,988 software developers and data experts.

how to change a cell's border colour onClick?

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
1 2263
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrew Poulos | last post by:
I'm trying to build a table using DOM methods with script that follows this type of format: // note the var bodyEl is predefined as the body element // var mytable =...
3
by: Peter Williams | last post by:
Hi All, I want to write some javascript for a html page which does the following. Imagine that the page contains a table with 2 columns and 3 rows, e.g.: +---+---+ | A | B | +---+---+
0
by: xprimus | last post by:
Can anyone help me with this, I have a linked image in a tale cell and whenever I click on the image it expands, not only that I have to click on it again to get the link to go. These are the...
4
by: html | last post by:
Hello all, I need to change the colour of my text. For the paragraph I do document.fgColor ="blue" ; but how do I do this for the select tags? ....and I prefer it to apply to all select tags...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.