JSFiddle - React, Tailwind, and code Playground

by Shirly Manor

HTML

<head>
    <title>ROI Calculator</title>
  <script src="script.js"></script>
  <script>
    function sumInputs9() {
    var sum = 0;

    var imp = Number(document.getElementById('imp').value);
    var avg = Number(document.getElementById('avg').value);
    var emp = Number(document.getElementById('emp').value);
    var eff = Number(document.getElementById('eff').value);
    var tot = document.getElementById('tot');
  
    sum = emp *eff/100 *52 * imp
    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>Impacted Employees:</p>
                <input type="number" id="imp" value="10"> 
            </div>
             <div class="arr">
                <p>Avg. annual salary: </p>
                <input type="number" id="avg" value="35000">$ 
            </div>  
            <div class="arr">
                <p>Employee hours/week, repetitive tasks:</p>
          ...