🖍 별도로 팝업창이 필요한 요소의 팝업창을 만들어 준다.
💡 주소검색, 주소검색결과, 아이디 중복검색, 아이디 중복검색 결과 페이지를 만들어보자!
파일 한개에 html, css, js 다 같이 작업
🟦 아이디 중복검색 : search_id.html
🔷 아이디 중복검색 결과 : result_id.html
🟧 주소 검색 : search_addr.html
🔶 주소 검색 결과 : result_addr.html

  <body>
    <form name="search_id_form" action="result_id.html" method="get" onsubmit="return check_id()">
      <fieldset>
        <legend>아이디 입력</legend>
        <p>
          <label for="">아이디</label>
          <input type="text" name="input_id" id="input_id" value="hong" />
          <button type="submit">검색</button>
        </p>
      </fieldset>
    </form>
  </body>
<button type="button">아이디 중복확인</button> 이벤트 핸들러 추가function id_search() { window.open("search_id.html", "", "width=600, height=250, left=0, top=0"); } 추가 (form_check 함수 밖에)
  <body>
    <p>
      입력하신 "hong"은 사용할 수 있는 아이디입니다.<br />
      <a href="#" onclick="return_id()">[사용하기]</a>
      <a href="#" onclick="history.back()">[다시 검색]</a>
    </p>
  </body>
    <script type="text/javascript">
      function return_id() {
        opener.document.getElementById("u_id").value = "hong";
        window.close();
      }
    </script>
history.back()은 뒤로가기 버튼 같은 기능
<body>
    <form name="search_addr_form" action="result_addr.html" method="get">
        <fieldset>
            <legend>주소 검색</legend>
            <p>
                동 입력
                <input type="text" name="s_addr" id="s_addr" value="역삼동">
                <button type="submit">확인</button>
            </p>
        </fieldset>
    </form>
</body>

<body>
  <p>
    입력하신 <span class="able">"역삼동"</span> 검색 결과입니다.
  </p>
  <hr>
  <p>
    <a href="#" onclick="return_add('06253', '서울 강남구 강남대로 123 (푸르덴셜타워)')">
      06253 서울 강남구 강남대로 123 (푸르덴셜타워)
    </a>
  </p>
  <p>
    <a href="#" onclick="return_add('12345', '서울 강남구 강남대로 456 (동희빌딩)')">
      12345 서울 강남구 강남대로 456 (동희빌딩)
    </a>
  </p>
  <p>
    <a href="#" onclick="return_add('67890', '서울 강남구 강남대로 789 (유성타워)')">
      67890 서울 강남구 강남대로 789 (유성타워)
    </a>
  </p>
</body>
  <script type="text/javascript">
    function return_add(pCode, addr) {
      opener.document.getElementById("address").value = pCode;
      opener.document.getElementById("addr1").value = addr;
      window.close();
    };
  </script>
<button type="button">주소검색</button> 이벤트 핸들러 추가function add_search() { window.open("search_addr.html", "", "width=600, height=250, left=0, top=0"); } 추가 (form_check 함수 밖에)