Editing
Eventfocus
비활성된 window
에서 활성으로 변경되는 경우 발생한다.
기본 개요
요소(element
)가 포커스(focus
)를 받을 때 발생한다.
설명
비슷한 focusin
이벤트와의 주요 차이점은 버블링(bubbing
)이다. focus
이벤트는 버블링이 발생하지 않는다.
구문
- 형식
window.addEventListener("focus", function() {});
- 형식
element.addEventListener("focus", function() { });
명세
type | focus |
---|
bubbles | no |
---|
cancelable | no |
---|
target | Element, Window |
---|
handler | onfocus |
---|
지원 웹브라우저