Dia 32
This commit is contained in:
53
Practicas/Practicas JS/Eventos 01/js/main.js
Normal file
53
Practicas/Practicas JS/Eventos 01/js/main.js
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
|
||||
function eurToDolar(){
|
||||
let eurosInput = document.getElementById('eurosInput');
|
||||
let dolarOutput = document.getElementById('dolarOutput');
|
||||
resultado = parseFloat(eurosInput.value)*1.09;
|
||||
dolarOutput.value=resultado.toFixed(2);
|
||||
}
|
||||
|
||||
function dolarToEur(){
|
||||
let dolarInput = document.getElementById('dolarInput');
|
||||
let eurOutput = document.getElementById('eurOutput');
|
||||
resultado = parseFloat(dolarInput.value)*0.9;
|
||||
eurOutput.value=resultado.toFixed(2);
|
||||
}
|
||||
|
||||
function pvpIVA(){
|
||||
let pvpInput=document.getElementById('pvpInput');
|
||||
alert(pvpInput.value*1.21)
|
||||
}
|
||||
|
||||
function frase() {
|
||||
let nombre = document.getElementById('nombre').value;
|
||||
let apellidos = document.getElementById('apellidos').value;
|
||||
let nacimiento = document.getElementById('nacimiento').value;
|
||||
let ciudad = document.getElementById('ciudad').value;
|
||||
let frase =document.getElementById('frase');
|
||||
frase.innerHTML= (`Hola ${nombre} ${apellidos} nacido el año ${nacimiento} en ${ciudad} <br>`)
|
||||
}
|
||||
|
||||
|
||||
function convertGC(){
|
||||
let tempC=parseFloat(document.getElementById('gc').value)
|
||||
let fahrenheit = (tempC*9/5)+32;
|
||||
let kelvin = tempC + 273.15;
|
||||
document.getElementById('gf').value=fahrenheit
|
||||
document.getElementById('gk').value=kelvin
|
||||
}
|
||||
function convertGF(){
|
||||
let tempF=parseFloat(document.getElementById('gf').value)
|
||||
let celsius = (tempF-32)*5/9
|
||||
let kelvin = celsius + 273.15;
|
||||
document.getElementById('gc').value=celsius
|
||||
document.getElementById('gk').value=kelvin
|
||||
}
|
||||
|
||||
function convertGK(){
|
||||
let tempK=parseFloat(document.getElementById('gk').value)
|
||||
let celsius = tempK - 273.15;
|
||||
let fahrenheit = (celsius-32)*5/9;
|
||||
document.getElementById('gc').value=celsius;
|
||||
document.getElementById('gf').value=fahrenheit;
|
||||
}
|
||||
Reference in New Issue
Block a user