Last active
May 31, 2017 04:14
-
-
Save johnathanDOS/70608af5126d5d03b567495c05379c8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<form action=""> | |
bill amount:<br> | |
<input type="text" id="bill" value="0.00"><br> | |
tip amount:<br> | |
<input type="text" id="tip" value="0.15"><br><br> | |
</form> | |
<button onclick="calculateTip()" id="calculate">Calculate Tip</button><br> | |
<p id = "tipHere"></p> | |
<script> | |
function calculateTip() { | |
var bill = document.getElementById("bill") | |
var tip = document.getElementById("tip") | |
document.getElementById("tipHere").innerHTML = | |
("$" +bill.value * tip.value); | |
} | |
</script> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment