Have u try this:
Code:
document.getElementById("subtotal").value = total;