Preciso que o value pegue o numero dos checkbox marcados e no fim ao clicar calcular precisava q me desse a soma dos valroes e diiscontasse o valor do desconto
<! DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="dedo.css"/>
<meta charset="UTF-8">
<figure>
<img src="cheddar.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="12.90"> Burger <INPUT class="trio" TYPE="checkbox" NAME="OPCAO" VALUE="15.90"> Trio </figcaption>
</figure>
<figure>
<img src="chicken.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="11.90"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="14.90"> Trio </figcaption>
</figure>
<figure>
<img src="frango_duplo.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="10.80"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="13.80"> Trio </figcaption>
</figure>
<figure>
<img src="moça_burger.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="10.90"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="14.90"> Trio </figcaption>
</figure>
<figure>
<img src="moça_frango.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="8.60"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="11.60"> Trio </figcaption>
</figure>
<figure>
<img src="moça_grill.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="13.20"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="16.60"> Trio </figcaption>
</figure>
<figure>
<img src="moça_kids.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="6.90"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="11.90"> Trio </figcaption>
</figure>
<figure>
<img src="moça1.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="16.40"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="18.80"> Trio </figcaption>
</figure>
<figure>
<img src="moça2.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="16.40"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="18.90"> Trio </figcaption>
</figure>
<figure>
<img src="moça3.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="14.60"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="18.90"> Trio </figcaption>
</figure>
<figure>
<img src="philadelphia.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="12.90"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="15.90"> Trio </figcaption>
</figure>
<figure>
<img src="saladabacon.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="9.90"> Burger <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="12.90"> Trio </figcaption>
</figure>
<figure>
<img src="salgados.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="10"> 25 Un <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="17"> 50 Un <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="22"> 75 Un <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="28.90"> 100 Un </figcaption>
</figure>
<figure>
<img src="pizza.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="32.90"> Média <INPUT TYPE="checkbox" NAME="OPCAO" VALUE="36.90"> Grande </figcaption>
</figure>
<figure>
<img src="batata.jpg" width="250px" height="200px">
<figcaption><INPUT TYPE="checkbox" NAME="OPCAO" VALUE="9.50"> Outros de R$ 9,50</figcaption>
</figure>
<section id="java">
<p><center>desconto de :</p>
<input type="text" id="desconto" />
<input type="submit" height="150px" value="Calcular" id="adivinhar"></center>
</section>
</head>
<body>
</body>
<script>
var aChk = document.getElementsByName("OPCAO");
for (var i=0;i<aChk.lenght;i++){ // Corre todas as checkboxes
if (aChk[i].checked == true){ // Se estiver seleccionada
valor = aChk[i].value; // O valor da seleccionada
}
}
var caixaDoNumero = document.getElementById("desconto").value;
var achou = false;
var n = 0;
var botaoClicado = function () {
n ++;
if (achou == true) {
alert("parabens")
} else {
alert("cliente numero: "+ n +" , "+"valor do pedido: "+ aChk[i].value);
window.print();
}
}
var botaoAdivinhar = document.getElementById("adivinhar");
botaoAdivinhar.onclick = botaoClicado;
</script>