• 회원가입
  • 로그인
  • 구글아이디로 로그인

[DOM_Event] JS - composedPath() 메서드 - 이벤트객체흐름파악 (=이벤트실행객체경로파악 = 컴포우즈드패스메서드, IE제외)

composedPath() 예제

 

<style>

div {

  padding:50px;

  background-color:rgba(255, 0, 0, 0.2);

  text-align:center;

  cursor:pointer;

}

</style>

<script>

function homzzang(event) {

  alert(event.composedPath());

}

</script>


<div>홈짱닷컴

  <div onclick="homzzang(event)">Homzzang.com</div>

</div> 

 

결과보기


 

결과값:  

[object HTMLDivElement],

[object HTMLDivElement],

[object HTMLBodyElement],

[object HTMLHtmlElement],

[object HTMLDocument],

[object Window] 

 



분류 제목
DOM_Event JS - url -
DOM_Event JS - which -
DOM_Event JS - which -
DOM_Event JS - view 속성 - 이벤트 발생한 Window 객체 반환 (= view속성 = 뷰속성)
DOM_Event JS - initMouseEvent() 메서드 - 폐기예고. 마우스이벤트초기화
DOM_Event JS - cancelBubble 속성 - 부모요소로 이벤트 확산 방지 (= 상위요소로 이벤트확산취소 = 캔슬…
DOM_Event JS - composedPath() 메서드 - 이벤트객체흐름파악 (=이벤트실행객체경로파악 = 컴포우즈드패스메…
DOM_Event JS - DOMContentLoaded 이벤트 ★★★★★ - 돔 웹문서 로드 완료 이벤트(= DOMConte…
DOM_Event JS - orientationchange 이벤트 - 장치 방향 바뀜 이벤트 (= 오리엔테이션체인지 이벤트) …
DOM_Event JS - returnValue 속성 - (폐기예고) defaultPrevented 속성으로 대체됨. (= r…
9/9
목록
찾아주셔서 감사합니다. Since 2012