[Javascript] for ... in 구문으로 객체의 하위 객체 알아내는 방법 Programming

* 출처 : 인터넷 프로그래밍 입문(HTML, CSS, Javascript) / 한빛미디어 / 주성례, 정선호, 한민형 공저

// for_in_object01.htm : window 객체의 하위 객체 알아내기
<html>
<head>
<title>객체 조작문 : window객체의 하위 객체 알아내기</title>
<head>

<script language="javascript">
<!--
document.write("<h3>window 객체의 하위객체 알아보기</h3>")
for (var i in window)
{
subObj="window." + i + "<br>"
i++
document.write(subObj);
}
-->
</script>

</head>
<body>
</body>
</html>

----------------------------------------------------------------

// for_in_object02.htm : window.document 객체의 하위 객체 알아내기
<html>
<head>
<title>객체 조작문 : window.document 객체의 하위 객체 알아내기</title>
<head>

<script language="javascript">
<!--
document.write("<h3>window.document 객체의 하위객체 알아보기</h3>")
for (var i in window.document)
{
subObj="window.document." + i + "<br>"
i++
document.write(subObj);
}
-->
</script>

</head>
<body>
</body>
</html>


트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://jin6093.egloos.com/tb/1122274 [도움말]

덧글

덧글 입력 영역