var a = prompt("Загадка:зимой и летом одним цветом?"); if (a = "ель" || "Ель") { alert("правильно"); } else { alert("неправильно"); } |
2 answers
You have two mistakes
- You confused the comparison operator (
==) and the assignment operator (=) - You are completely wrong using the operator LOGICAL OR (
||)
Must be so
var a = prompt("Загадка:зимой и летом одним цветом?"); if ((a == "ель") || (a == "Ель")) { alert("правильно"); } else { alert("неправильно"); } - Thank!!!!!!!! - Verzilamv
|
Assignment:
a="ель" Comparison:
a == "ель" - Thank you! I'm just learning) It would not be possible to throw off the correct code !! - Verzilamv
|