В общем задача необходимо создать форму состоящую из двух строк.
- 1-я строка: пользователь сайта вводит сумму
- 2-я строка: отображается это значение умноженое на определенное число.
Пробовал сделать так:
function countCharPass(val) {
var quantity = document.getElementById('quantity').value;
if (quantity == "") {
alert("Вы не указали суму");
} else {
cena = 440;
stoimost = quantity * cena;
document.getElementById('vivod').value.innerHTML = "Стоимость равна: " + stoimost + " р.";
}
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<h3>Расчет стоимости</h3>
<input type="text" id="quantity" name="quantity" onkeyup="countCharPass(this) value=" " placeholder="Введите суму для обмена ">
<input type="text " id="vivod " name="vivod " value=" " placeholder=" ">