First, "float" is not a valid input type. You can find a list of them here:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
We'll change those to number instead. Next, we need an id for each input so we can target them.
Here is the corrected HTML:
<form>
How much #dirtyFiat U.S. Dollars?
<input id='dirtyinput' type="number" name="dirtyfiat"> What is the price of bitcoin?
<input id='priceinput' type="number" name="price">
<input id='submit' type="submit" value="Let's go!">
</form>
<p id="sats"></p>
For the javascript, first reference the ids with document.getElementById() and store those ids in variables. Next, assign the result of the math to a variable.Next, we save the the button id to a variable. Then, add the event listener to the submit button. Then, we call the
Here is the corrected JS:
var output = document.getElementById('submit-btn');
output.addEventListener('click', function() {
var x = document.getElementById('dirtyinput').value;
var y = document.getElementById('priceinput').value;
var result = x / y / 100000000;
document.getElementById("sats").innerHTML = result;
})
This is the basic version of what you requested. There is a lot more you can do with error handling and value checking.