code from 30-04-26
This commit is contained in:
27
Zweites Jahr/javascript/dropdown.html
Normal file
27
Zweites Jahr/javascript/dropdown.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dropdown Menü</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Elektronischer Wahlzettel, der Landtagswahl in BA-WÜ</h1>
|
||||
|
||||
<form>
|
||||
<select name="partei" id="auswahl">
|
||||
<option value="Andreas Stoch"> SPD </option>
|
||||
<option value="Manuel Hagel"> CDU </option>
|
||||
<option value="Cem Özdemir"> B: 90 / Die Grünen </option>
|
||||
<option value="Hans-Ulrich Rülke"> FDP </option>
|
||||
</select>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
document.getElementById("auswahl").addEventListener("change", function() {
|
||||
let value = this.value;
|
||||
alert("Du hast gewählt: " + value);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user