JavaScript TEMPERATURE CONVERSION PROGRAM 🌡️

Pubblicato il: 04 novembre 2023
sul canale di: Bro Code
40,432
858

#JavaScript #project #programming

00:00:00 HTML
00:04:20 CSS
00:10:43 JavaScript

// TEMPERATURE CONVERSION PROGRAM

const textBox = document.getElementById("textBox");
const toFahrenheit = document.getElementById("toFahrenheit");
const toCelsius = document.getElementById("toCelsius");
const result = document.getElementById("result");
let temp;

function convert(){

if(toFahrenheit.checked){
temp = Number(textBox.value);
temp = temp * 9 / 5 + 32;
result.textContent = temp.toFixed(1) + "°F";
}
else if(toCelsius.checked){
temp = Number(textBox.value);
temp = (temp - 32) * (5/9);
result.textContent = temp.toFixed(1) + "°C";
}
else{
result.textContent = "Select a unit";
}
}


In questa pagina del sito puoi guardare il video online JavaScript TEMPERATURE CONVERSION PROGRAM 🌡️ della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 04 novembre 2023, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 40,432 volte e gli è piaciuto 858 spettatori. Buona visione!