加个toFixed
<script>
function doit(){
var str=document.all.T1.value*document.all.T2.value;
document.all.T3.value=str.toFixed(1);
}
</script>
<body><form method="POST" action="--WEBBOT-SELF--">
<input type="text" name="T1" size="20">
<input type="text" name="T2" size="20" onkeyup="doit();">
<input type="text" name="T3" size="20">
<input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2">
</form>
<script>
function doit(){
var str=document.all.T1.value*document.all.T2.value;
document.all.T3.value=str.toFixed(1);
}
</script>
<body><form method="POST" action="--WEBBOT-SELF--">
<input type="text" name="T1" size="20">
<input type="text" name="T2" size="20" onkeyup="doit();">
<input type="text" name="T3" size="20">
<input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2">
</form>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货