JSFiddle - React, Tailwind, and code Playground
HTML
<h1> Paralax Motors Corps. </h1>
<h2> Sales ($ Millions) </h2>
<p>Eastern Division: <input type="text" id="Eastern" onchange=''></p>
<p>Western Division: <input type="text" id="Western" onchange=''></p>
<button id="Total Sales" onclick='total()'>Calculate Total</button>
<p>2017 Total Sales: <span id="sales2017"></span></p>
<p>Estimate for 2018:
<input type="radio" onclick='estimate(high_increase);'>high
<input type="radio" onclick='estimate(low_increase);'>low
</p>
<p>2018 Expected Sales: <span id="sale2018"></span></p>
CSS
body {
background-color: yellow
}
JavaScript
var high_increase = 0.30;
var low_increase = 0.10;
var total_2017 = 0;
function total() {
total_2017 = (+Eastern.value) + (+Western.value);
sales2017.innerHTML = total_2017.toFixed(2);
}
function estimate(increase) {
sale2018.innerHTML = (total_2017 * (1 + increase)).toFixed(2);
}