I want to be able to pass D, I, H, and A to the next page. My code on that page needs to be able to access their values. Here's what I have tried so far:
function tally() {
var Dpoint, Ipoint, Hpoint, Apoint;
var party_Score = ['Dpoint', 'Ipoint', 'Hpoint', 'Apoint'];
var D, I, H, A;
var value_Point;
var type_Choice;
var tag_Choice;
var inputs = document.getElementsByTagName("input"),
iLength = inputs.length;
D = I = H = A = 0;
for (i = 0; i < iLength; i++) if (inputs[i].checked) {
value_Point = parseInt(inputs[i].value);
if (inputs[i].name.search('D') > -1){ D += value_Point; }
if (inputs[i].name.search('I') > -1){ I += value_Point; }
if (inputs[i].name.search('H') > -1){ H += value_Point; }
if (inputs[i].name.search('A') > -1){ A += value_Point; }
}
// DIHA is areadly added how to pass them them to other page ?
document.getElementById('D').style.width = D + 'px';
alert(D);
document.getElementById('I').style.width = I + 'px';
document.getElementById('H').style.width = H + 'px';
document.getElementById('A').style.width = A + 'px';
Dpoint = D; //passing this value to next page
Ipoint = I; //passing this value to next page
Hpoint = H; //passing this value to next page
Apoint = A; //passing this value to next page
}