Advertisement
Guest User

Untitled

a guest
May 28th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <html>
  2. <title> Age calculator</title>
  3. <body>
  4. <h1>agecalculator</h1>
  5. <input type="text" name="age" id="age">
  6.  
  7. <input type="button" value="submit" id="age" onClick =agecalculator(document.getElementByID('age').value)>
  8. < script>
  9. function agecalculator(age){
  10. var age = 28;
  11. var maxAge = 100;
  12. var numPerDay = 2;
  13. var totalNeeded = (numPerDay * 365) * (maxAge - age);
  14. var message = 'You will need ' + totalNeeded + ' cups of tea to last you until the ripe old age of ' + maxAge;
  15. console.log(message);
  16. }
  17. </script>
  18.  
  19.  
  20. </body>
  21. </html?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement