How can I get the total value of all the values that have a class called total
<script>
function gettotal()
{
var total = 12;
}
</script>
<input type=text class=total value=5>
<input type=text class=total value=7>
<input type=submit name=submit value="Add" onclick=gettotal();>