<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JavaScript: Verzweigungen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description"
content="Übung JavaScript. Verzweigungen">
<meta name="keywords" content="HTML, JavaScript">
<meta name="author" content="Roland Unger">
</head>
<body>
<h2>Übung JavaScript</h2>
<h3>Verzweigungen</h3>
<script language="JavaScript" type="text/javascript">
var a=3;
document.write("a: ", a, "<br> <br>");
if (a<3) {
document.write("Ergebnis ist gut oder sehr gut") }
else {
document.write("Ergebnis ist nicht gut") };
document.write("<br> <br>");
switch (a) {
case 1: document.write("Ergebnis ist sehr gut");
break;
case 2: document.write("Ergebnis ist gut");
break;
case 3: document.write("Ergebnis ist befriedigend");
break;
case 4: document.write("Ergebnis ist ausreichend");
break;
case 5: document.write("Ergebnis ist ungenügend");
break;
default: document.write("Ergebnis ist keine gültige Zensur");
}
</script>
</body>
</html>