codice:
function rimuovi(n) {
var togli = document.getElementById("totale"+n).value;
var totale = document.getElementById("totFattura").value;
var totFatturaNuovo = totale - togli;
document.getElementById("totFattura").value = totFatturaNuovo.toFixed(2);
var rimuoviRiga = document.getElementById("riga"+n);
rimuoviRiga.remove();
for (i=n+1; i<=cont; i++) {
document.getElementById("prestazione"+i).setAttribute("id", i-1);
document.getElementById("id"+i).setAttribute("id", i-1);
document.getElementById("importo"+i).setAttribute("id", i-1);
document.getElementById("qnt"+i).setAttribute("id", i-1);
document.getElementById("selectValue"+i).setAttribute("id", i-1);
.... ecc ecc..... per tutti i campi della riga
document.getElementById("prestazione"+i).setAttribute("onkeyup","javascript:calcolaQuantita("+(i-1)+");";
.... ecc eccc... per tutti gli eventi, compreso calcola
}
cont--;
}
potrebbe esserci qualche errore nella sintassi... ho scritto di fretta... però il concetto è questo....