Hallo Carsten,
case 0:
if(window.document.quiz.auswahl[1].checked == true)
die if-Bedingung würde ich vor switch setzen, da sie jedesmal vorkommt.
document.getElementById("zwei").style.backgroundColor = "#FF8080";
document.getElementById("eins").style.backgroundColor = "#0080FA";
das lässt sich vielleicht mit (ungetestet):
---
function farbe(id,farbnr){
farben = new Array("#FF8080","#0080FA");
document.getElementById(id).style.backgroundColor = farben[farbnr];
}
//und als Aufruf:
farbe('zwei',0);
farbe('eins',1);
---
kürzen.
Grüße aus Nürnberg
Tobias
--
Selfcode: sh:( fo:) ch:? rl:( br:< n4:& ie:% mo:| va:) de:] zu:) fl:( ss:| ls:[ js:|
Selfcode: sh:( fo:) ch:? rl:( br:< n4:& ie:% mo:| va:) de:] zu:) fl:( ss:| ls:[ js:|