0

I know this must be simple because I cannot find a reference to it. I would like to use javascript to load the background-color value of a table row into a css file. The background will vary depending on which menu option is chosen. To hopefully clear this up, the row has a css class and I would like to populate that with a color. Thanks in advance.
Bob

Edited by bvaz: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by bvaz
0

actually that is the way it was to start...however, client would like to have different colors based up which menu option is selected. Thus, rather than having different lines of code, only need to change it via the js....hope that was clear.....Can this be done?
thanks for the reply.

0

actually that is the way it was to start...however, client would like to have different colors based up which menu option is selected. Thus, rather than having different lines of code, only need to change it via the js....hope that was clear.....Can this be done?
thanks for the reply.

no that's not true, you will be forced to have more lines of code if you try that manipulation through javascript, and on top of it all, you will be having to much problems with browsers and moreover this aproach is not reliable. Changing style declarations dynamically will give you more headache than you can think off.
I also don't think that there are clients with such demands, because if your client understands things like these than he must be your coding teacher not your client.

0

ok will take your advice.....just seemed so easy to change with what i thougt would be one line of code.....kudos to you.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.