Background Color

G

Guest

Hi,

I have the following javascript that should change the background color of
an element in a table:

script.Append("document.getElementById(selectedDateId).style.backgroundColor
= \"#00008b\"; \n");
script.Append("document.getElementById(selectedDateId).className =
\"AIMSSelectedDay\"; \n");

However, the color is never changed. I tried to put some "alert" statement
to see whether the function is accessed, and it is. Am I doing something
wrong?

Thanks.
Mike
 
K

Karl Seguin

Is there a javascript error? (use fireforx and type javascript: to see
errors).

Karl
 
K

Karl Seguin

I ask because the javascript looks fine, all I can think of is that
selectedDateId isn't a valid identifier..:

I imagine you are actually doing something like:
getElementById(\"" + selectedData.UniqueId + "\")...

OR

selectedDataId is an actual JS variable which you hopefully properly assign
before this code executes..

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top