<!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=utf-8" />
<title>无标题文档</title>
<script language="vbscript">
function aa()

dim a1
a1=document.form1.a1.value
document.getElementById("bb").innerHTML=a1
end function
</script>
</head><body><form id="form1" name="form1" method="post" action="">
  <label>
  <input type="text" name="a1" id="a1" />
  </label>
  <label>
  <input type="button" name="button" id="button" value="按钮" onclick="aa()" />
  </label>
</form>
<span id="bb"></span>
</body>
</html>

解决方案 »

  1.   

    <!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=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function aa(){
    var a1;
    a1=document.form1.a1.value
    document.getElementById("bb").innerHTML=a1
    }
    </script>
    </head><body><form id="form1" name="form1" method="post" action="">
      <label>
      <input type="text" name="a1" id="a1" />
      </label>
      <label>
      <input type="button" name="button" id="button" value="按钮" onclick="aa()" />
      </label>
    </form>
    <span id="bb"></span>
    </body>
    </html>
    javascript没问题  你的vbscript就不懂了  貌似你发错位置了
      

  2.   

    建议把:<script language="vbscript">
    function aa()dim a1
    a1=document.form1.a1.value
    document.getElementById("bb").innerHTML=a1
    end function
    </script>删除, language="vbscript"改为:function aa(){
        var a1=document.form1.a1.value
        document.getElementById("bb").innerHTML=a1
    }
      

  3.   

    vbscript是ie的东东,firefox运行当然不行了。。
      

  4.   

    楼主本身就写的ie only的代码。firefox不认识的。
      

  5.   

    这样啊 ,谢谢大家。,,因为这个非得用 VBS 实现 ,,,