Here is my current code:
var drip = document.getElementById("years");
var slider = document.getElementById("rate");
var output = document.getElementById("dum");
var deed
output.innerHTML = slider.value;
slider.oninput = function() {
output.innerHTML = this.value;
}
//Formula for Interest Rate is Final = Amount(1+Interest Rate*No. of Years)
body{background-color:black;}
h1{color:grey;}
h1{font-family: Verdana,Geneva,sans-serif;}
div {background-color:white;}
div {border-radius: 35px;}
div div{margin-left: 260px}
div{font-family: Verdana,Geneva,sans-serif;}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div>
<center><h1><b>Simple Interest Calculator</b></h1></center>
<div>
Amount <input type="number" id="principal"><br>
<br>
Interest Rate <input type="range" min="0" max="20" value="50" class="slider" id="rate"><p id="dum"></p><br>
<label for="years">No. of Years</label>
<select name="years" id="years">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select><br>
<br>
<!--recheckthisInterest Rate: <span id="result"></span><br>-->
<input type="button" value="Compute Interest" onClick="compute();">
</div>
<br>
© Everyone Can Get Rich
</div>
<script src="script.js"></script>
</body>
</html>
I would like to have it when the compute button is pressed, values are taken from the respective inputs and calculated into interest. But I'm not sure how. I'm new to this and I can't really find anything that helps. I've tried to do '''var something = document.getElementById("input_id").value;''' but it does nothing to work. I can't even use it in functions properly.