Open up your console, it says: Uncaught SyntaxError: Unexpected token ILLEGAL, demo.php:68
...
var total1 = document.getElementById("total1").value = total;
}​
These might be caused by a BOM if you're using different files/includes to generate the output. Otherwise, it might just be some copy/paste error. Just remove the }​</script> to make sure the 'invisible' chars are gone between } and < and then type }</script> again and be done with it.