你错过了(这里
还==用于比较,单=用于分配。
if (cboStatus == 'Closed')
{
lbCloseDate.style.display = "";
}
进入这个街区了吗?如果是这样,我建议改变.display =“”; to .display =“none”
你也可以给你的一个ID,然后用它来隐藏/显示行而不是标签。将在句法上更正确。
修改强>
以下是基础知识:
function showOrHideRow(){
var theRow = document.getElementById('closeRow');
var theDropDown = document.getElementById('ChangeMe');
var theVal = theDropDown.options[theDropDown.selectedIndex].value;
if(theVal == 'Closed'){
theRow.style.display = 'none';
}
else{
theRow.style.display = 'block';
}
}
和html:
Close Date: |
another row |
Change me
Hide It
Don't Hide It