43 lines
1.0 KiB
HTML
43 lines
1.0 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
Nicola Clark
|
|
15APR25
|
|
-->
|
|
<!--
|
|
Adapted from https://javascript30.com - Event Capture, Propagation, Bubbling, and Once
|
|
|
|
Changes:
|
|
* moved CSS + JS to external files
|
|
* [HTML] changed favicon
|
|
* [CSS] modified colorscheme
|
|
* [JS] added JSDoc comment to logText for type suggestions in VScode
|
|
* [HTML] added text to button
|
|
* [CSS] added styles to button
|
|
-->
|
|
<!--
|
|
New elements:
|
|
New attributes:
|
|
New JS:
|
|
* capture param to addEventListener
|
|
* evt.stopPropagation to keep event from bubbling
|
|
* once param to addEventListener
|
|
-->
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Understanding JavaScript's Capture</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="icon" href="https://fav.farm/bubbles">
|
|
<link rel="stylesheet" href="asset/main.css">
|
|
</head>
|
|
<body class="bod">
|
|
<div class="one">
|
|
<div class="two">
|
|
<div class="three"></div>
|
|
</div>
|
|
</div>
|
|
<button>Click me :)</button>
|
|
<script src="asset/main.js"></script>
|
|
</body>
|
|
</html>
|