Last active
March 31, 2019 18:59
-
-
Save BolajiAyodeji/f9d728fc405f63a881ee5eaa90e3b3e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const input = document.getElementById('lbsInput'); | |
const output = document.getElementById('output'); | |
output.style.visibility = 'hidden'; | |
input.addEventListener('input', (e) => { | |
let lbs = e.target.value; | |
output.style.visibility = 'visible'; | |
let grams = document.getElementById('gOutput'); | |
grams.innerHTML = lbs/0.0022046; | |
let kiloGrams = document.getElementById('kgOutput'); | |
kiloGrams.innerHTML = lbs/2.2046; | |
let ounces = document.getElementById('ozOutput'); | |
ounces.innerHTML = lbs*16; | |
e.preventDefault(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment