我在我的默认网页中有一个div。 div样式显示没有,那时在页面加载事件我必须得到状态没有,但div状态改变了基于下拉选择的javascript功能,我dosenot得到none状态总是显示“”状态,我的代码是如何在javascript中更改div属性之前获取c#.net中的div显示属性
aspx页面
<div id="Div1" runat="server" clientidmode="Static" style="display: none;">
页面加载事件
string Display1 = "";
Display1 = Div1.Style["display"]; (working fine)(get the display1 value=none)
当我按一下按钮显示在C#代码一样,在div
Div1.Style.Add("display", "");(now show the div it is correct)
下拉改变火javascript函数代码
document.getElementById('Div1').style.display = 'none'; (after change dropdown Hide the div after pageload i got Display1 value="")
改变javascript函数我doenot得到页面加载的无状态
你确切什么不会?你不会显示或隐藏你的div plz的回复。 – Rajpurohit
我想隐藏div – hmk