2
0

code from 20-5-26

This commit is contained in:
2026-05-20 13:43:13 +02:00
parent 810a541924
commit 44623ba94e
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
const x =5;//const ist eine permanente Variable die nicht verändert werden kann
let y = 4;//mit let definieren wir Variablen die noch verändert werden können
//alert wird jedesmal ausgegeben wenn javascript geladen wurde
alert("JAVASCRIPT FUNKTIONIERT");
const feld1 = document.getElementById("name");
feld1.addEventListener("input", function(){
if(feld1.value.length > 4){
feld1.style.backgroundColor="green";
}
else{
feld1.style.backgroundColor="red";
}
})
function laenge(){
const feld2 = document.getElementById("adresse");
// feld2.innerHTML="not long enaugh";
feld2.addEventListener("input", function(){
if(feld2.value.length > 4){
feld2.style.backgroundColor="green";
}
else{
feld2.style.backgroundColor="red";
}
}
)}