我需要检查变量是否大于4个其他变量。 有没有办法做到这一点? 到目前为止我已经尝试了
if(Guitar > Percussion || Brass || Keyboard || Woodwind)
{
var guitarpage = document.getElementById("GuitarPage");
guitarpage.style.display ="block";
}
if(Percussion > Guitar || Brass || Keyboard || Woodwind)
{
var percussionpage = document.getElementById("PercussionPage");
percussionpage.style.display ="block";
}
if(Brass > Percussion || Guitar || Keyboard || Woodwind) {
var brasspage = document.getElementById("BrassPage");
brasspage.style.display ="block";
}
if(Keyboard > Percussion || Guitar || Brass || Woodwind) {
var keyboardpage = document.getElementById("KeyboardPage");
keyboardpage.style.display ="block";
}
if(Woodwind > Percussion || Guitar || Keyboard || Brass) {
var woodpage = document.getElementById("WoodwindPage");
woodpage.style.display ="block";
}
以及使用&&但我要么显示每个div,要么根本不显示。