Web Development

General discussion


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

By trupti_korde ·

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";
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


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Related Discussions

Related Forums