|
@@ -72,14 +72,18 @@
|
|
|
|
|
|
case "switch: if":
|
|
case "switch: if":
|
|
let color = prompt("Введите цвет", "");
|
|
let color = prompt("Введите цвет", "");
|
|
- if ((color == "red") || (color == "black")) {
|
|
|
|
|
|
+ if (color == "red") {
|
|
document.write("<div style='background-color: red;'>красный</div>")
|
|
document.write("<div style='background-color: red;'>красный</div>")
|
|
document.write("<div style='background-color: black; color: white;'>черный</div>");
|
|
document.write("<div style='background-color: black; color: white;'>черный</div>");
|
|
|
|
+ }else if (color == "black"){
|
|
|
|
+ document.write("<div style='background-color: black; color: white;'>черный</div>");
|
|
}
|
|
}
|
|
|
|
|
|
- else if ((color == "blue") || (color == "green")) {
|
|
|
|
|
|
+ else if (color == "blue") {
|
|
document.write("<div style='background-color: blue;'>синий</div>");
|
|
document.write("<div style='background-color: blue;'>синий</div>");
|
|
document.write("<div style='background-color: green;'>зеленый</div>");
|
|
document.write("<div style='background-color: green;'>зеленый</div>");
|
|
|
|
+ }else if (color == "green") {
|
|
|
|
+ document.write("<div style='background-color: green;'>зеленый</div>");
|
|
}
|
|
}
|
|
|
|
|
|
else {
|
|
else {
|