이벤트(Event) - 이벤트 전달(Event Propagation)
이벤트 전달 : 태그에서 발생된 이벤트가 다른 태그로 전달 - 캡쳐링 >> 타겟 >> 버블링
캡쳐링(Capturing) 단계 : 이벤트가 부모 태그에서 자식 태그로 전달
타겟(Target) 단계 : 이벤트가 발생된 태그로 전달
버블링(Bubbling) 단계 : 이벤트가 자식 태그에서 부모 태그로 전달
<div id="one">
<div id="two">
<div id="three"></div>
</div>
</div>
<script type="text/javascript">
document.getElementById("one").onclick=function() {
location.href="https://www.daum.net";
event.stopPropagation();
}
document.getElementById("two").onclick=function() {
location.href="https://www.naver.com";
event.stopPropagation();
}
document.getElementById("three").onclick=function() {
location.href="https://www.google.com";
event.stopPropagation();
}