input type=button value="Вычислить" onclick='GiveResult();'>
<br/>
<br/>
<label><span id="result" class="result"></span></label>
</form>
<script type="text/javascript">
c = new Array();
n = new Array();
c[0] = 1;
n[0] = "USD";
c[1] = 0.75;
n[1] = "EUR";
c[2] = 63.01;
n[2] = "RUB";
function GiveResult()
{
var res, vfrom, vto, vcash;
vcash = document.getElementById("cash").value;
vfrom = document.getElementById("from").value;
vcash = vcash.replace(',', '\.');
vcash = vcash.replace(' ', '');
vcash = vcash.replace(' ', '');
vto = document.getElementById("to").value;
res = c[vto] * vcash / c[vfrom], 2;
res = res.toFixed(2);
res = res.toString();
res = res.replace('\.', ',');
res = "<span class='result'> Результат перевода: " + res + "</span> " + n[vto];
document.getElementById("result").innerHTML = res;
}
</script>