1. 버튼에서 바로 새로고침하는 경우
: window.location.reload();
<button type="button" onclick="window.location.reload();">다시하기</button>
2. function함수안에서 사용하는 경우
: location.reload();
<button type="button" onclick="reset();">다시하기</button>
//버튼 : 다시하기
function reset(){
location.reload();
}
'HTML.CSS.JS > JS' 카테고리의 다른 글
[JS] day08_event2 (클릭시 스타일 변경) (0) | 2023.04.18 |
---|---|
[JS] day08_event_welcome (0) | 2023.04.18 |
[JS] day07_과제 (이름,점수,합계,평균 출력) (0) | 2023.04.17 |
[JS] day07_event_input (데이터받기) (0) | 2023.04.17 |
[JS] day07_event (버튼 클릭 이벤트) (0) | 2023.04.17 |