Is there an 'or' operator for an if statement? I want to change the value of a text field depending on the content of another. If the value is "Your Company" OR (in german) "Ihr Unternehmen", it's supposed to leave the #cmp field blank. Otherwise it should take over the value. I can't get it working with an or operator (second code block), nor with an else if statement.
// Working for one string:
if ($("#listencmp").val() != "Ihr Unternehmen") {
var comp = $("#listencmp").val();
$("#cmp").val(comp);
} else {
$("#cmp").val("");
}
// Not working for two strings:
if ($("#listencmp").val() != "Ihr Unternehmen" || "Your Company") {
var comp = $("#listencmp").val();
$("#cmp").val(comp);
} else {
$("#cmp").val("");
}