Discussion Locked

How to change selected text bg color in html tree structure?

0 helpful
0 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi

I am changing the applet trees to HTML trees..

When the node is selected i am changing that selected node's background to some color but when I select other node that previous node's color remains changed and next selected node's color changes.
I want that only selected nodes color to be changed and the previous selected nodes color should get back to its color.

this is the function i am writing:
***********************************************
function changeColor(id)
{

if(document.getElementById("II"+id).style.background== "blue")
{
document.getElementById("II"+id).style.background= "white";
document.getElementById("II"+id).style.color= "blue";
}
else
{
document.getElementById("II"+id).style.background= "blue";
document.getElementById("II"+id).style.color= "white";
}

}

**********************************************

and i am calling this fun in showbranch where i get the selected node id.

If someone knows how to do it then please let me know

regards,
trupti.

0 replies

No replies were posted before this discussion closed.

This discussion is closed to new replies.