Tag: Dex has no text. text keyword ace NTB button java
S code
JavaScript Code?
12345678910111213141516 |
function
show_more_mess()
{
$(
"#background_div"
).css(
"width"
,
"100%"
);
//获取这个div的时候是没有问题的
$(
"#background_div"
).css(
"height"
,
"100%"
);
$(
"#background_div"
).css(
"position"
,
"absolute"
);
$(
"#background_div"
).css(
"left"
,
"0"
);
$(
"#background_div"
).css(
"top"
,
"0"
);
$(
"#background_div"
).css(
"display"
,
"block"
);
alert(document.getElementById(
"more_mess"
).innerHTML);
//这边是作测试用的,报错显示获取不到这个元素
}
function
show_div()
{
$(
"#more_mess"
).css(
"display"
,
"block"
);
//这边没有象没有执行一样
}
|
asp. Net foreground code
C # code?
1234567 |
<div id=
"background_div"
runat=
"server"
style=
"position:absolute; display:none; background:#999999; filter:Alpha(opacity=50)"
>
</div>
<div id=
"more_mess"
runat=
"server"
style=
"position:absolute;width:100px; height:100px; background:red; display:none; z-index:10"
>
<div>账户:<asp:TextBox ID=
"TextBox_show_username"
runat=
"server"
></asp:TextBox></div>
<div>密码:<asp:TextBox ID=
"TextBox_show_pwd"
runat=
"server"
></asp:TextBox></div>
</div>
|
Asp. Net Backend Code
C # code?
123456789101112 |
background_div.InnerHtml =
"<script>show_more_mess();"
;
try
{
TextBox_show_pwd.Text =
"a"
;
TextBox_show_username.Text =
"b"
;
background_div.InnerHtml =
"<script>show_div();</script>"
;
//后台是可以获取到more_mess这个div的
}
catch
(Exception ee)
{
}
|
I think it's Weird. I hope the master can help me see where the problem is.
What is the reason for JavaScript not getting the element by id?