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(); | |
}); | |
if ('serviceWorker' in navigator) { | |
window.addEventListener('load', () => { | |
navigator.serviceWorker.register('../sw.js').then( () => { | |
console.log('Service Worker Registered') | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment