<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<script type="text/javascript">
function o()
{
var t = document.getElementById('t');
alert(t.offsetWidth);
}
</script>
</head>
<body>
<div >
<dl>
<dt id="t" onmouseover="o()">Dropdown One</dt>
<dd>Item One</dd>
</dl>
</div>
</body>
</html>
输出结果 500px
如何获取t的宽 就是"Dropdown One"这些文字的宽。