日期:2014-05-16 浏览次数:20386 次
<script type="text/javascript">
function chooseOne(cb) {
//先取得Div元素
//var obj = document.getElementById("mydiv");
var obj=document.getElementsByName("check");
///判斷obj中的子元素i是否為cb,若否則表示未被點選
for (i=0; i<obj.children.length; i++){
if (obj.children[i]!=cb) obj.children[i].checked = false;
//若是 但原先未被勾選 則變成勾選;反之 則變為未勾選
else obj.children[i].checked = cb.checked;
//若要至少勾選一個的話,則把上面那行else拿掉,換用下面那行
//else obj.children[i].checked = true;
}
}
function Math_Click(){
var rusult=0;
var check_array=document.getElementsByName("check");
for(var i=0;i<check_array.length;i++)
{
if(check_array[i].checked==true)
{
rusult=parseInt(rusult)+parseInt(check_array[i].value);
}
}
sum01.innerHTML =rusult;
}
</script>
function chooseOne(thisObj){
//查看对某一评价是否唯一
var score = parseInt($("#score").html());
var thisScore = parseInt($(thisObj).val());
if($(thisObj).siblings(':checked').length >= 1){//如果同一评价存在多个选择
var other = $(thisObj).siblings(':checked');
var otherScore = parseInt($(other).val());
score = score - otherScore;
$