I am applying style to div using JavaScript it appears well at the first time but when I click an image to open a virtual window the applied CSS goes away.
How can I apply style using script that stays forever.
**There is no way left for me to apply any style at design time because I am using ready made user control and I get ID for the DIV only at run time.
Any Idea??
Here is the script I am using…
window.onload = changeDivOverflow;
function changeDivOverflow()
{
var treeDiv = document.getElementById('T_ctl00contentMainctl04tvw');
treeDiv.style.overflow = "auto";
}
All styles you apply using javascript and DOM calls, apply only to element you are applying it. In your example it will be only element with ID = ‘T_ctl00contentMainctl04tvw’
If you want to reuse that style for more than one element, you should create a CSS class and store that style there. Then apply that class for every element you want. If you want to do it with script, then you should: