add js demos for chapter 3: manipulate, classlist, create, events, preventdefault, todo, fetch, localstorage

This commit is contained in:
2026-04-20 13:14:56 +02:00
parent 754ff9436c
commit 7626852ac1
25 changed files with 664 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<title>Element manipulieren</title>
<style>
body { font-family: system-ui, sans-serif; padding: 1.5rem; }
h3 { margin: 0.5rem 0 0.4rem; font-size: 0.85rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.04em; }
.demo { border: 1px solid #e5e7eb; border-radius: 6px; padding: 12px; margin-bottom: 14px; background: #f9fafb; }
#meinElement { color: red; background: #fee2e2; padding: 8px 12px; border-radius: 4px; }
</style>
</head>
<body>
<h3>Vorher</h3>
<div class="demo"><p>Alter Text</p></div>
<h3>Nach JavaScript</h3>
<div class="demo">
<p id="meinElement">Neuer Text</p>
</div>
<script>
// element.textContent = "Neuer Text";
// element.style.color = "red";
</script>
</body>
</html>