본문 바로가기

카테고리 없음

javascript 자식창에서 부모창 컨트롤 하기 자식창에 쓰기

<body>
<table border=1 width=200 height=100>
 <tr>
  <td>1</td>
  <td>2</td>
 </tr>
 <tr>
  <td>3</td>
  <td>4</td>
 </tr>
</table>
<script>
test=window.open('','tst','width=300,height=200');
test.document.write("<body><input type=button onclick=\"a=opener.document.getElementsByTagName('TABLE')[0];a.style.backgroundImage='url(http://static.naver.com/kin/img/topmenu_02.gif)'\" value='배경 이미지 바꾸기'>"); //부모창의 table 태그의 컬렉션을 a에 할당, 첫번째 배열의 배경이미지를 교체
</script>