试图做到这一点,但它错了吗?以下是我尝试加载的样式和脚本以及html。如何根据另一节的计算宽度设置节的宽度?
<style>
#bar {
background:black;
width: </style><script>var barWidth = getElementByID("nav").style.width; document.write (nav);</script><style>
height: 5px;
}
</style>
<section id="nav">
<a href="#">Link1</a>
<a href="#">Link2</a>
<a href="#">Link3</a>
<span id="loginButton"><a href="#">Login</a></span>
<section id="bar"></section>
</section>
哦,我的,我是哑巴哈哈!谢谢Xander! – MrDrewskii 2012-02-01 02:13:05