Skip to content

Instantly share code, notes, and snippets.

@valokafor
Created September 8, 2017 20:18
Show Gist options
  • Save valokafor/f5e0df9be00b0fb23ea98444146901a4 to your computer and use it in GitHub Desktop.
Save valokafor/f5e0df9be00b0fb23ea98444146901a4 to your computer and use it in GitHub Desktop.
function calculateTotal(){
var price = parseFloat(document.getElementById("totalPrice").value);
var tax = price * 8.4 / 100;
var totalPrice = price + tax;
alert("Total price: " + totalPrice);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment