익스플로러에서 getElementById 안먹는 경우.. 어찌 해야 하나요?
본문
다음 소스에서 id="hp_cnf"를 보이는 단순한 스크립트인데
크롬에선 되는데, 익스플로러에선 안먹네요. 익스플로러 10입니다.
이걸 어찌 해야하나요?
<
script
>
function hp_check() {
alert('00');
}
function hp_auth_exec() {
//alert('00');
document.getElementById('hp_cnf').style="display:block;";
f = document.frm;
f.target = "hiddenframe";
f.action="./bbs/hp_auth.exec.php";
f.submit();
}
function hp_auth_cnf() {
f = document.frm;
f.target = "hiddenframe";
f.action="./bbs/hp_auth.cnf.exec.php";
f.submit();
}
</
script
>
<
form
name
=
"frm"
id
=
"frm"
method
=
"post"
>
<
input
type
=
"hidden"
name
=
"mb_hp_auth"
id
=
"mb_hp_auth"
>
<
input
type
=
"text"
name
=
"mb_hp1"
id
=
"mb_hp1"
value
=
"010"
>-<
input
type
=
"text"
name
=
"mb_hp2"
id
=
"mb_hp2"
value
=
"9076"
>-<
input
type
=
"text"
name
=
"mb_hp3"
id
=
"mb_hp3"
value
=
"0755"
><
input
type
=
"button"
id
=
"mb_hp_btn"
value
=
"전송"
onclick
=
"javascript:hp_auth_exec();"
>
<
div
class
=
""
name
=
"hp_cnf"
id
=
"hp_cnf"
style
=
"display:none;"
>
<
input
type
=
"text"
name
=
"nums"
value
=
""
><
input
type
=
"button"
value
=
"인증"
onclick
=
"hp_auth_cnf();"
>
</
div
>
</
form>
답변 2
document.getElementById('hp_cnf').style.display = "block";
스크립트가 잘못되어 있네요
document.getElementById('hp_cnf').style.display="block";
로 바꾸시면 될겁니다.