codice:
var Textarea = document.getElementsByTagName("select");
for(j=0; j<Textarea.length; j++)
{
if (Textarea[j].value != "0")
{
var quantita = Textarea[j].value;
var id = "id"+Textarea[j].name;
var prezzo = document.getElementById(id).innerHTML;
var totale = quantita * prezzo;
alert(totale);
}
}
cosi riesco ad ottenere il totale. Numero selezionato dalla select * valore che trovo con getElementById.
Solo che
1*1.2 = 1.2
2*1.2 = 2.4
3*1.2 = 3.59999999996
4*1.2 = 4.8
5*1.2 = 6
perchè la terza me la dà con le cifre decimali? :master: