code from 30-04-26
This commit is contained in:
@@ -12,6 +12,9 @@ Wichtige Informationen
|
|||||||
- JavaScript - [./javascript](/Zweites%20Jahr/javascript/)
|
- JavaScript - [./javascript](/Zweites%20Jahr/javascript/)
|
||||||
- Unterrichts Projekt - [./unterrichts_projekt](/Zweites%20Jahr/unterrichts_projekt/portal/register.php) (Register Seite)
|
- Unterrichts Projekt - [./unterrichts_projekt](/Zweites%20Jahr/unterrichts_projekt/portal/register.php) (Register Seite)
|
||||||
|
|
||||||
|
## 30-04-26
|
||||||
|
- Event Listener
|
||||||
|
|
||||||
## 29-04-26 - JS + PHP
|
## 29-04-26 - JS + PHP
|
||||||
- Login in PHP (unfertig)
|
- Login in PHP (unfertig)
|
||||||
- Einstieg in JAVASCRIPT
|
- Einstieg in JAVASCRIPT
|
||||||
|
|||||||
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>
|
||||||
28
Zweites Jahr/javascript/eventlistener.html
Normal file
28
Zweites Jahr/javascript/eventlistener.html
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>EventListener</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h1>EventListener</h1>
|
||||||
|
<button id="myBtn">Try it</button>
|
||||||
|
<button id="myBtn2">Click erst um 13:45 Uhr drauf!</button>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Normaler Funktionsaufruf nach Button click
|
||||||
|
document.getElementById("myBtn").addEventListener("click", myFunc);
|
||||||
|
|
||||||
|
function myFunc(){
|
||||||
|
alert("Button clicked!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Anonyme Funktion nach Button click
|
||||||
|
document.getElementById("myBtn2").addEventListener("click", function(){
|
||||||
|
alert("Schule aus!")
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user