Answer the question
In order to leave comments, you need to log in
How to take data in select from option except value and display it in #id?
Hey!
There is an input.
I'm used to taking only value values and then doing math with it.
Here is an example:
<p>Сумма: <span id="info1"></span></p>
<select onchange="costCalculator()" id="money">
<option value="10">Rub</option>
<option value="20">Usd</option>
<option value="30">Eur</option>
</select>
<p>Валюта: <span id="info2"></span></p>
function costCalculator() {
var y = document.getElementById("money").value;
info1.innerHTML = y
var x = document.getElementById("money").value;
info2.innerHTML = x
}
Answer the question
In order to leave comments, you need to log in
Codepen
If I understood correctly, you are interested in something similar?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question