Background Color

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Is there a javascript error? (use fireforx and type javascript: to see
errors).

Karl
 
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
 
Back
Top