Sascha Schulz
2023-10-24 4d46431f0a310f3fe2d74f54dd2b67340c1e68a2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
    </head>
    <body>
        <div>
            <button>click</button>
        </div>
        <script>
            const div = document.querySelector("div");
            const button = document.querySelector("button");
 
            function doSomething(e) {
                console.log("capture");
            }
 
            function click(e) {
                console.log("bubble");
            }
 
            div.addEventListener("click", doSomething, true);
 
            button.addEventListener("click", click, false /* default */);
        </script>
    </body>
</html>