DOM EventListener: Fungsi Konversi Fahrenheit ke Celcius

October 4, 2018

 

document.getElementById("masuk").oninput = function conf2c() {
let f = document.querySelectorAll(".hasil");
let i1 = f[0].value;
f[1].value = `${((5/9) * (i1 - 32)).toFixed(2)} C`
}

Hasilnya:

=


Leave a Reply

Your email address will not be published. Required fields are marked *