I'm trying to write javascript code where there is an object called "costCenter" which the visibility should be false. but when i click on the "computer" item on my dropdownlist it will set the "costcenter" visibility to true.
so far this is what i have. is this the proper use of syntax for javascript?
function hideMe()
{
var g = document.getElementById('costcenterid');
var e = document.getElementById('dg_form_ctl02_DropDownList1');
if(e == 'computer')
{
g.style.display = 'block';
else
g.style.display = 'none';
}
}
C# code behind
ClientScript.RegisterStartupScript(GetType(),"hwa","hideMe();",true);
i found this code from somewhere, but i'm not sure what goes in the "hwa"
SetVisibleis valid, this looks like it should work