So my question is could I for example display one number 1.00 and then do a calculation on it eg (times it by 85) and show the output in HTML5? (Without using forms?).
I have seen examples that use inputs, but I don't really need user input, I just want it to do a calculation on load.
If you see one of my pages below, you will see that there are a list of prices and I want to convert them all to a different currency (I don't need to get the currency rate (I can add that manually, just want it to do the basic calculation eg : 100 rupees = 0.95 pounds Calulation (100*0.95) Returns £0.95p
For example :
So I just want to input the current exchange rate in one place and it will calulate the £ rates for each entry in the list.
Create a new
<script> tag in the head section as follows with some variable name.
<script> var exchange_rate = .95; </script>
Where ever you want to do calculations use as following
<p> Cost of Cooking : <script> document.write(exchange_rate * 100); </script> </p>
So, if you change the
exchange_rate in the head section's
<script> tag, it will show proper values wherever you used it.
This recipe can be found in it's original form on Stack Over Flow.