I am brand new to html and fairly new to coding in general. I know this is basic but I find adapting someone elses code for my needs helps me learn much faster than just going through tutorials.
I want to create a currency exchange site. I would like to select a currency, enter the ammount, and see how much I would get in £ in return.
my code;
function Converter(){
if (document.converter.currency.value = EUR)
document.converter.pound.value = document.converter.ammount.value * 0.9
if (document.converter.currency.value = USD)
document.converter.pound.value = document.converter.ammount.value * 0.6
}
<form name="converter">
<table border="0">
<tr>
<td>
<select name = "currency">
<option value="EUR" selected> Euro </option>
<option value="USD">Dollar</option></select>
</td>
<td>
<input type="text" name="ammount" onChange="Converter()" />
</td>
</tr>
<tr>
<td>£:</td>
<td><input type="text" name="pound" disabled /></td>
</tr>
</table>
</form>
I would like to know if this is the right way to do this and mainly, how to refernce the select menu in javascript.
Thanks for your time!