javascript控制div显示的问题:无法得到display属性,参数无效
<DIV id= "fieldsDiv " style= "BORDER-RIGHT: 2px inset; BORDER-TOP: 2px inset; BACKGROUND: #999999; BORDER-LEFT: 2px inset; WIDTH: 100%; BORDER-BOTTOM: 2px inset;position:absolute;height:150;width:200;left:50px;top:50px;
z-index:1;border:1;display:none; "
>
让该div显示的语句:
alert(document.getElementById( 'fieldsDiv ').style.display); document.getElementById( 'fieldsDiv ').style.display= "visibility ";
运行时alert能弹出窗口显示“none "
但是div显示不出来,提示标题那样,哪里出问题了呢?
------解决方案--------------------document.getElementById( 'fieldsDiv ').style.display= "block ";