JSFiddle - React, Tailwind, and code Playground
by Shirly Manor
HTML
<head>
<title>ROI Calculator</title>
<script src="script.js"></script>
<script>
function sumInputs3() {
var sum = 0;
var dis = Number(document.getElementById('dis').value);
var ema = Number(document.getElementById('ema').value);
var cur = Number(document.getElementById('cur').value);
var imp = Number(document.getElementById('imp').value);
var avg = Number(document.getElementById('avg').value);
var con = Number(document.getElementById('con').value);
var tot = document.getElementById('tot');
sum = ((dis * ema * imp/100 *con/100)-(dis * ema * cur/100 *avg *con/100))
tot.textContent = (sum).toLocaleString()
sum = 0
}
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Compact Form</title>
<style>
body {
font-family: Arial, sans-serif;
}
.container {
max-width: 400px;
margin: 0 auto;
}
.arr {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.arr p {
flex: 1;
margin: 0;
}
.arr input[type="number"] {
width: 150px;
text-align: right;
}
.arr img {
width: 20px;
margin-right: 5px;
}
#calculate {
width: 100%;
background-color: #007BFF;
color: #fff;
border: none;
padding: 10px;
cursor: pointer;
}
#calculate:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="container">
<div class="inputs">
<div class="arr">
<p>Distributaion list size</p>
<input type="number" id="dis" value="1000000">
</div>
<div class="arr">
<p>Email frequency (per year)</p>
...