错了!补充一下 <!-- 请问各位大虾,如何用javascript控制 div.style 的 z-index 属性?-->

解决方案 »

  1.   

    <div style="position: absolute; background-color: blue; top: 15; left: 10; width: 985; height: 16; z-index: 1">第一个层</div>
    <div style="position: absolute; top: 15; left: 10; width: 985; height: 16; z-index: 2">第二个层</div>
    <div style="position: absolute; top: 15; left: 10; width: 985; height: 16; z-index: 3">第三个层</div>
    <div id=a style="position: absolute; background-color: red; top: 15; left: 10; width: 985; height: 16; z-index: 4">第四个层</div>
    <br><br><br><br><br>
    <button onclick="a.style.zIndex='0'">a</button>