<!-- 버튼 및 클릭 이벤트 처리 ( black-button 은 . black-button 으로 css 적용 )-->
<button id="redirectButton" class="black-button">캘린더</button>
<script>
// 버튼 이벤트 처리(위의 id 와 getElementById()의 괄호 아이디 동일하게)
document.getElementById("redirectButton").addEventListener("click", function() {
// 버튼을 클릭하면 지정된 URL로 이동( board-front/DatePicker/index.html은 파일명)
window.location.href = "http://127.0.0.1:5500/board-front/DatePicker/index.html";
});
</script>
'프론트엔드' 카테고리의 다른 글
React Router의 useNavigate 훅을 사용하여 페이지 이동 기능을 구현 (0) | 2024.05.29 |
---|---|
테이블 (0) | 2024.05.22 |
import { Outlet, useLocation } from 'react-router-dom'; (0) | 2024.05.12 |
랜더링 (0) | 2024.05.12 |
<Route element={<Container />}> {/* 공통 컨테이너 적용 */} (0) | 2024.05.09 |