1. Browser Event Handling
Events connect user interactions (clicks, keyboard strokes, form submissions) to JavaScript logic.
⊞HTML5 Web Code (index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Event Listeners</title>
</head>
<body style="background:#17181c; color:#fff; font-family:Arial; padding:30px;">
<h2>Interactive Event Studio</h2>
<input type="text" id="live-input" placeholder="Type something here..." style="padding:10px; width:260px; background:#1f2029; border:1px solid #444; color:#fff; border-radius:6px;" />
<p id="live-feedback" style="margin-top:12px; color:#04AA6D; font-weight:bold;"></p>
<script>
const input = document.getElementById("live-input");
const feedback = document.getElementById("live-feedback");
input.addEventListener("input", (e) => {
feedback.textContent = "Live Text: " + e.target.value;
});
</script>
</body>
</html>
