<h5>A:<input type = "text" id = "a" name = "a" size = "15" style="text-align:right" />元</h5>
<h5>B:<input type = "text" id = "b" name = "b" size = "15" style="text-align:right" />元</h5>
<script type = "text/javascript">
function sum(){
var amount_unit = document.getElementById("a").value;
var amount_person = document.getElementById("b").value;
var amount_sum = parseFloat(a) + parseFloat(b);
document.getElementById('sum').value=sum;
}
</script>
<h5>总额:<input name="sum" id = "sum" size = "19" style="text-align:right" readonly />元</h5>