a mio parere hai invertito l' assegnazione

Codice PHP:
<script language="javascript">
function 
somma() {
    
    var 
subtotale document.getElementById("imponibile").value;
    var 
iva document.getElementById("iva").value;
    
subtotale = (isNaN(parseFloat(subtotale)) ?  parseFloat(subtotale));
    
iva = (isNaN(parseFloat(iva)) ?  parseFloat(iva));

        
totale = (subtotale+iva).toFixed(2);
        
document.getElementById("fattura").value totale;
}
</script>