code from 20-5-26
This commit is contained in:
@@ -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";
|
||||
}
|
||||
}
|
||||
)}
|
||||
Reference in New Issue
Block a user