var bookRate = new Array('The Right to differ', 'Issues In Contemporary Documentary', 'Writing, Directing and Producing', 'Lee Kuan Yew My Lifelong Challenge');
var selection = document.rate.checkbox;
var sum = 0.00 ;
for (i=0; i<selection.length; i++)
if (selection[i].checked == true)
alert('Book Name : ' + bookRate[i] + ' \n Price of the book : ' + selection[i].value)
alert('Total Purchased Books : ' + selection[i].value);
這是我現在擁有的。如何獲得多個1複選框的值,以在JavaScript中總計它?
我需要知道如何總計,如果有兩個複選框選中?
此功能只顯示選定的項目。
的HTML將真正幫助在這裏。 –