Home >Web Front-end >JS Tutorial >javascript event problem_javascript skills

javascript event problem_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:47:09872browse
Copy code The code is as follows:


Hello


1. When the mouse is placed on , only alert('world') and alert('hello') will be executed in sequence. It can be seen that the event response The function is executed in the bubbling phase, that is, for DOM-compatible browsers, it is not executed in the capturing phase. Therefore, the event response function written in HTML will only be executed during the bubbling stage.
2. When the mouse is moved from the div to the span, alert('out_div'), alert('world'), and alert('hello') will be executed in sequence. This shows that although the span is in the div, But when you move the mouse from the div to the span, it is also regarded as moving the mouse out of the div.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn