У меня проблемы со следующим кодом.Вот HTML-часть
<form name="convert">
Choose which currency you would like to convert the Euro to:
<select id="conversionType">
<option value="polish">Polish Zloty</option>
<option value="ukraine">Ukraine Hryvnia</option>
</select>
</br>
</br>
<hr>
Amount:<input id="amount" type="text" />
<input id="convertButton" type="button" value="Convert->"/>
To:
<input id="answer" type="text" name="answer" readonly="readonly"/>
</form>
, а вот код JavaScript.это было изменено и помогло раньше, но я не могу понять, почему это не работает
window.onload = initPage;
var euro;
var convert;
function initPage()
{
document.getElementById("convertButton").onclick = calcAnswer;
document.getElementById("conversionType").onchange = calcAnswer;
}
function calcAnswer()
{
//alert(document.getElementById("conversionType").value);
var value1 = document.getElementById("amount").value1;
var conversionType = document.getElementById("conversionType").value1;
//alert(conversionType);
//if(var value = document.getElementById("conversionType").value=="polish");
// document.getElementById("answer").value=value1 * 4.4976;
//else
// document.getElementById("answer").value=value1* 10.43958;
if(conversionType == "polish") {
document.getElementById("answer").value1=value1 * 4.4976;
} else {
document.getElementById("answer").value1=value1 * 10.43958;
}
}
это не будет работать вообще.я не знаю почему, потому что я думаю, что теория обоснована.любая помощь будет высоко ценится