ROI

<!DOCTYPE html>
<html>
<head>
<title>ROI Calculator</title>
</head>
<body>
<h1>ROI Calculator</h1>

<label for=”investment”>Initial Investment:</label>
<input type=”number” id=”investment” placeholder=”Enter initial investment”><br>

<label for=”returns”>Returns:</label>
<input type=”number” id=”returns” placeholder=”Enter returns”><br>

<button onclick=”calculateROI()”>Calculate ROI</button>

<p id=”result”>ROI: 0%</p>

<script>
function calculateROI() {
const initialInvestment = parseFloat(document.getElementById(“investment”).value);
const returns = parseFloat(document.getElementById(“returns”).value);
const roi = ((returns – initialInvestment) / initialInvestment) * 100;

document.getElementById(“result”).textContent = `ROI: ${roi.toFixed(2)}%`;
}
</script>
</body>
</html>

Verified by MonsterInsights