<div id="layer1" onclick="f1(this)" onmousedown="f2(this)" style="position:absolute;z-index:1;left:100px;"></div><script type="text/javascript">
function f1(obj){
   alert(obj.style.left);//这里没错,会打出100px
}function f2(obj){
   alert(obj.style.z-index);//这里有错,为什么同是style里的参数,left可以,z-index就出错
}</script>我是打算通过JS来控制<div>的层次,也就是z-index值,但是在JS函数里(如上)得不到z-index的值,为什么?