|
Hello,
In my web application i want to change the color of menu font dynamically.
I am using external css for menu that id is #buttons
the menu font color resides in #buttons a{color:red;}
I want to change it through javaScript dynamically.I have created a session(control value assigned to session) and session value is assigned to hiddenfield.
I have used following code but it's not working proper.
function SetValue()
{
menufontcolor = document.getElementById('buttons');
menufontcolor.style.color =
document.getElementById('HiddenField8').value;
}
I have called SetValue() at body section OnLoad Event.
Please help me..
Thanks
Regards
Sunil Sharma
modified 28-Jan-13 6:32am.
|
|
|
|
|
1. SetValue() & setValue() are two different method names. See it this is the issue.
2. Why hidden field and all? Just switch the css at runtime.
Debug and share what is happening and if you get any error.
|
|
|
|