蓝森林首页 | 返回主页 | 本站地图 | 站内搜索 | 联系信箱 |
 您目前的位置:首页 > 自由软件 > 技术交流 > 应用编程


    

蓝森林 http://www.lslnet.com 2006年8月25日 8:28

tt.innerHTML="OKI ELECTRONICS"中间2个空格,怎么

[html]
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>高级按钮</title>
</head>
<script language='javascript'>
function aa()
{
  tt.innerHTML="OKI  ELECTRONICS (HONG KONG) LTD";
}
</script>
<body>
<form method="POST">
        <div id="tt"></div>
        <button name="B3" onclick="aa()">按钮</button>
</form>
</body>

</html>
[/html]
请大家看一个现象,OKI  ELECTRONICS中间是有2个空格的。当按按钮赋值的时候为什么显示出来的时候就只有一个空格呢

[html]
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>高级按钮</title>
</head>
<script language='javascript'>
function aa()
{
  tt.innerHTML="OKI&nbsp;&nbsp;ELECTRONICS (HONG KONG) LTD";
}
</script>
<body>
<form method="POST">
        <div id="tt"></div>
        <button name="B3" onclick="aa()">按钮</button>
</form>
</body>[/html]

tt.innerText="OKI  ELECTRONICS (HONG KONG) LTD";




Copyright © 1999-2000 LSLNET.COM. All rights reserved. 蓝森林网站 版权所有。 E-mail : webmaster@lslnet.com