• Image placeholder
  • 홈 페이지
  • 블로그 센터
  • 범주
Image placeholder

bubbling

[JS30] -25) Event Capture, Bubbling, Propagation and Once

Bubbling 상위 div에 클릭 이벤트를 등록하고, 가장 안쪽 주황색을 눌렀을 때 하위 div에서부터 이벤트가 Bubbling 되어 three,two,one 순으로 출력된다. Capturing capture을 true로 주면 이벤트 캡처링으로 상위 div에서 하위 div로 전파되어 one,two,three 순으로 출력된다. Once를 true로 설정하면 이벤트를 들고해 한번 호출한 후 해...

oncestopPropagationcapturingbubblingevent delegationbubbling

target / currentTarget

Javascript 그리고 React를 사용하다보면 어떤 곳을 클릭해야하는 일이 생기며, 이 클릭한 요소를 가져오는 방법이 필요하다. 이 때 사용하는 것이 바로 e.target.value 혹은 e.currentTarget.value 이다. 그런데 이 둘은 어떻게 다른 것일까? 이를 알기 위해서는 이벤트 버블링에 대해서 알아야하는데, 이는 나중에 다시 포스팅하도록 하겠다. 우선 간단하게 이 둘...

bubblingCurrentTarget@Target@Target

© 2022 intrepidgeeks.com

Privacy Policy Contact US Sitemap
🍪 This website uses cookies to ensure you get the best experience on our website. Learn more