JavaScript

[Window_Object] JS - blur() 메서드 - 포커스 해제/제거 (= blur메서드 = 블러메서드)

목차
  1. blur() 예제 - 현재창에서 포커스 제거
  2. blur() 정의
  3. blur() 구문
  4. focus() 예제 - 새창 포커스 지정

 

blur() 예제 - 현재창에서 포커스 제거 

 

<button onclick="homzzang()">클릭</button>


<script>

function homzzang() {

  var hz = window.open("", "", "width=200, height=100");

  hz.document.write("<p>홈짱닷컴 Homzzang.com</p>");

  hz.blur();

}

</script>

 

결과보기

 

blur() 정의

 

현재 창에서 포커스 제거.

 


 

1. cf.

focus() 메서드 - 현재 창에 포커스 설정.

 

2. 주의.

이 메서드는 현재 창을 배경으로 가져오도록 요청함. 그 결과,

사용자 설정 달라서 모든 브라우저에서 예상대로 작동 안 할 수도 있음.

 

3.

모든 브라우저 지원.

 

4. MDN focus() 예제 보기
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus


 

blur() 구문

 

window.blur()

 


[매개변수]

 

없음.



[반환값]

 

없음.

 

 

focus() 예제 - 새창 포커스 지정

 

<button onclick="homzzang()">클릭</button>


<script>

function homzzang() {

  var hz = window.open("", "", "width=200,height=100");

  hz.document.write("<p>홈짱닷컴 Homzzang.com</p>");

  hz.focus();

}

</script>

 

결과보기

PS. 새창에 focus 주면, 새 창을 앞으로 보냄.



분류 제목
DOM_Event_Object JS - StorageEvent 객체 - 윈도우창 저장영역 변경 (= 스토리지이벤트객체= 스토리지이벤트종류)
DOM_Event_Object JS - TouchEvent 객체 - 터치이벤트객체 (= 터치이벤트종류)
DOM_Event_Object JS - TransitionEvent 객체 - CSS 전환 실행 (= 트랜지션이벤트객체 = 트랜지션이벤트종류…
DOM_Event_Object JS - UiEvent 객체 - 유저인터페이스변환 (= 유아이이벤트객체 = 유저인터페이스이벤트종류 = 사용자…
DOM_Event_Object JS - WheelEvent 객체 - 마우스휠움직임 (= 휠이벤트객체)
API_Geolocation JS - coordinates -
API_Geolocation JS - position -
API_Geolocation JS - positionError -
API_Geolocation JS - positionOptions -
API_Geolocation JS - clearWatch() 메서드 -
API_Geolocation JS - getCurrentPosition() 메서드 -
API_Geolocation JS - watchPosition() 메서드 -
Window_History JS - history.length 속성 - history개수 (= 방문이력개수 = 방문주소개수 = 히스토리…
Window_History JS - history.back() 메서드 ★ - 이전페이지 가기
Window_History JS - history.forward() 메서드 - 다음페이지 가기
53/89
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인