一段代码看不出什么问题  但在网页上点没有反应啊
 请高手们帮忙看看
<!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 language="javascript" type="text/javascript">
function aaa(id){
var nowMoney = document.getElementById('showmoney').innerText ;
var nowMoney = parseFloat(nowMoney);
alert(nowMoney);
var selectMoney = document.getElementById(id).value;
var selectMoney = parseFloat(selectMoney); if(document.getElementById(id).checked){
         document.getElementById('showmoney').innerText = nowMoney+selectMoney;
}else{
document.getElementById('showmoney').innerText = nowMoney-selectMoney;
}
</script></head>
<body>
<form name="form1">
<table>
<tr>
<td id="showmoney">0.00</td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox1" id="1" onclick="aaa(this.id)" value="1.1111111111"/> </td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox1" id="2" onclick="aaa(this.id)" value="2.2222222222"/></td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox1" id="3" onclick="aaa(this.id)" value="3.3333333333"/></td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox1" id="4" onclick="aaa(this.id)" value="4.444444444"/></td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox1" id="5" onclick="aaa(this.id)" value="5.5666666666"/></td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox1" id="6" onclick="aaa(this.id)" value="6.644444444"/></td>
</tr>
</table>
</form>
</body>
</html>

解决方案 »

  1.   

    <script language="javascript" type="text/javascript">
    function aaa(id){
    var nowMoney = document.getElementById('showmoney').innerText ;
    var nowMoney = parseFloat(nowMoney);
    alert(nowMoney);
    var selectMoney = document.getElementById(id).value;
    var selectMoney = parseFloat(selectMoney);if(document.getElementById(id).checked){
      document.getElementById('showmoney').innerText = nowMoney+selectMoney;
    }else{
    document.getElementById('showmoney').innerText = nowMoney-selectMoney;
    }
    }
    </script>
    function没关闭