Gelt Calculator
3 days ago in Plain Text
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chanuks Gelt Calculator</title>
</head>
<body>
<input id="age" type="text">
<button onclick="calc()">Calculate</button>
</body>
<script>
const inp = document.getElementById('age');
function calc(){
const numb = eval(inp.value);
const total = numb*0.01+numb*0.05+numb*0.10+numb*0.25+numb*0.50+numb*1.00+numb*1.00+numb*2.00+", ";
const text = document.createTextNode(total);
const $ = document.createTextNode("$");
const body = document.querySelector("body");
text.nodeValue = `${total}`
body.appendChild($);
body.appendChild(text);
}
</script>
</html>