Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <title> Age calculator</title>
- <body>
- <h1>agecalculator</h1>
- <input type="text" name="age" id="age">
- <input type="button" value="submit" id="age" onClick =agecalculator(document.getElementByID('age').value)>
- < script>
- function agecalculator(age){
- var age = 28;
- var maxAge = 100;
- var numPerDay = 2;
- var totalNeeded = (numPerDay * 365) * (maxAge - age);
- var message = 'You will need ' + totalNeeded + ' cups of tea to last you until the ripe old age of ' + maxAge;
- console.log(message);
- }
- </script>
- </body>
- </html?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement