事件冒泡(bubbling)和捕获(capturing)的区别?事件流是什么?
What's the difference between event bubbling and capturing? What is the event flow?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: easy
标签: LinkedIn, Events, Bubbling, Capturing
目标岗位: Front End Software Engineer, Frontend Engineer, Web Developer
目标公司: LinkedIn
参考答案摘要
答案 事件流(event flow) 分三阶段: Capturing phase :事件从 window/document 向下到目标元素。 Target phase :到达目标元素本身。 Bubbling phase :从目标元素向上冒泡回祖先。 监听方式 addEventListener(type, handler, { capture: true }) → 捕获阶段触发 默认 capture...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。