General discussion

Locked

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

By trupti_korde ·
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 conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Web Development Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums