<script langaue="javascript">
function compute(t){
var num;
num=parseFloat(document.body.t2.value);
if(t=="t")
window.alert();??????????????????我点击  确认button时  弹出一个小窗口 并显示密码
}
</script>
</head>
<body>
账户信息:
请妥善保管你的账户信息,以免发生损失
账号:<input type="text" name="t1" value="123435" id="t1">
密码:<input type="password" name="t2" value="" id="t2">
<button name="t3" value="t3" id="t3" onclick="compute('t')">确认</button>
</body>
</html>

解决方案 »

  1.   

    密码:<input type="password" name="t2" value="" id="t2">
    返回是  这个的  value
      

  2.   

    用表单啊,你这个很不规范勒
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    </head> <body>
    <script langaue="javascript">
    function compute() {
    var num;
    num = parseFloat(document.getElementById("t2").value);
    window.alert(num);
    }
    </script>
    </head>
    <body>
    账户信息: 请妥善保管你的账户信息,以免发生损失
    <br>
    账号:
    <input type="text" name="t1" value="123435" id="t1">
    <br />
    密码:
    <input type="password" name="t2" value="" id="t2">
    <button name="t3" value="t3" id="t3" onclick=
    "compute()";
    >
    确认
    </button>
    </body>
    </html>
    </body>
    </html>