Good day everyone, I need help with a simple currency converter, which can convert from dollar to euros and vice versa, something like that link
The only thing I have done was to copy the code of the example that you indicate and make a couple of changes so that it is a currency converter, you would have to give it the necessary styles so that it is as you have it in the image:
function eurosDolares(valNum) {
document.getElementById("inputDolares").value=valNum*1.156236;
}
function dolaresEuros(valNum) {
document.getElementById("inputEuros").value=valNum*0.864875337;
}
<html>
<title>Conversor de moneda.</title>
<body>
<h2>Conversor de moneda.</h2>
<p>
<label>Euros</label>
<input id="inputEuros" type="number" placeholder="Euros" oninput="eurosDolares(this.value)" onchange="eurosDolares(this.value)">
</p>
<p>
<label>Dolares</label>
<input id="inputDolares" type="number" placeholder="Dolares" oninput="dolaresEuros(this.value)" onchange="dolaresEuros(this.value)">
</p>
</body>
</html>