How to change selected text bg color in html tree structure? - TechRepublic
General discussion
June 9, 2004 at 04:10 AM
trupti_korde

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

by trupti_korde . Updated 22 years, 1 month ago

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.

This discussion is locked

All Comments