javascript: evaluating multiple if statements without also running else
问题 i'm trying to throw together a simple javascript page with multiple if statements. the idea is to append to a list based on the evaluation of a stack of if statements. the problem is if any one of them fails, it triggers the else statement. i only want it to trigger else in the case that all of them fail. <p id="fruit">My fruit basket has: </p> if (apples) { document.getElementById("fruit").innerHTML += "apples"; } if (oranges) { document.getElementById("fruit").innerHTML += "oranges"; } if