Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

chapter07 : 키보드_이벤트 본문

WEB.JS/10.EVENT_JS

chapter07 : 키보드_이벤트

GAWON 2023. 5. 22. 09:20
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	document.onkeydown = function(e){
		var key = e.keyCode;
		
		// 뒤로가기 : 8
		// 새로고침 : 116
		
		if(key == 8 || key == 116){
			e.preventDefault();
		}
		
		
	}
</script>
</head>
<body>
	<h1>새로고침(F5)과 뒤로가기(BackSpace) 금지 페이지</h1>
</body>
</html>

'WEB.JS > 10.EVENT_JS' 카테고리의 다른 글

chapter03 : 이벤트_객체  (0) 2023.05.22
chapter04 : 디폴트_이벤트  (0) 2023.05.22
chapter05 : 마우스_이벤트  (0) 2023.05.22
chapter06 : 키보드_이벤트  (0) 2023.05.22
chapter : JOIN_JS  (0) 2023.05.22