javascript问题,我就纳闷了。哪里的问题?

来源:百度知道 编辑:UC知道 时间:2024/06/01 06:44:56
<script type="text/javascript">

function mycheck(obj)
{
for(var i=0; i<document.all.test.length;i++)
{
if(document.all.test[i].checked)
document.all.dis_play[i].innerText=obj;
else
(document.all.dis_play[i].innerText="");
}
}

function showprice(money){
for(var i=0;i<document.all.showprice.length;i++){
if(document.all.showprice[i].checked)
document.all.showprice_money[i].interText=money;
else
(document.all.showprice_money[i].interText="");
}
}

</script>
</head>
<body>
<input type="radio" name="showprice" value="0" onclick="showprice(2200)" />一班
<input type="radio" name="showprice" value="1" onclick="showprice(2600)" />二班
<input type=

楼上的都乱说
showprice(money){ 里
document.all.showprice_money[i].interText=money;
(document.all.showprice_money[i].interText="");

interText替换为innerText,仔细点

方法名和控件的名称最好不要一样
<input type="radio" name="showprice" value="0" onclick="showprice(2200)" />一班
两个 都 叫showprice不行

首先你的HTML都有错,同一个HTML文档里,ID是应该唯一的,而你的ID却并不唯一。你把你的的目的说下,我给你重写。