动态CSS样式中DISPALY失去控制
.divstyle { position:absolute; top:200px; left:250px; border-style:solid; border-color:Red; border-width:2px; display:none; } </style> <script type="text/javascript"> function sj1() { var div1 = document.getElementById("div1"); div1.style.display = ""; } </script> </head> <body> <a href="javascript:sj1()">登录</a> <div id="div1" class="divstyle" >
去display:none样式能正常显示在屏幕,把样式直接写入div也正常,以上写法,隐藏了DIV点击指定按钮就无法显示出来,请教如何修改,谢谢了!!
div1.style.display = "block";