Simple Weight Converter App With JavaScript & Bootstrap 4




In this mini-project tutorial we will be building a simple weight converter app using JavaScript and Bootstrap 4 for the ui. It will convert pounds to grams, kilograms and ounces. This will be pure vanilla JavaScript with no JS libraries or frameworks.

CODE: Code for this project

BECOME A PATRON: Get special perks
http://www.patreon.com/traversymedia
ONE TIME DONATIONS:
http://www.paypal.me/traversymedia

FOLLOW TRAVERSY MEDIA:
http://www.facebook.com/traversymedia

http://www.instagram.com/traversymedia

COURSES & MORE INFO:
http://www.traversymedia.com

Original source


29 responses to “Simple Weight Converter App With JavaScript & Bootstrap 4”

  1. Traversy Media HELP ME
    How to put an input restriction to 60000 lbs?
    My don't work code bottom 🙁
    *****
    if (isNaN(lbs) || lbs < 1 || lbs > 60000) {
    alert("С такой зарплатой есть особенности. Формулы для вашего дохода находятся в разработке.");
    } else {
    document.getElementById('output').style.visibility = 'hidden'
    document.getElementById('zarp').addEventListener('input', function(e){
    document.getElementById('output').style.visibility = 'visible'
    let lbs = e.target.value;
    document.getElementById('gramsOutput').innerHTML = lbs*0.13 + " руб.";
    document.getElementById('kgOutput').innerHTML = lbs*0.30 + " руб.";
    document.getElementById('kg2Output').innerHTML = ((lbs*0.13)+(lbs*0.30)) + " руб.";
    document.getElementById('ozOutput').innerHTML = ((lbs*0.13)+(lbs*0.30))*12 + " руб.";
    }); ;
    }

  2. how to fix issue on ReactJs when run ur code
    Here the Console Error:
    Uncaught TypeError: Cannot read property 'keys' of undefined
    at Object.n.283.290 (browser.min.js:8)
    at i (browser.min.js:2)
    at browser.min.js:2
    at Object.n.273.283 (browser.min.js:8)
    at Object.n.655.273 (browser.min.js:14)
    at i (browser.min.js:2)
    at browser.min.js:2
    at Object.n.645.634 (browser.min.js:14)
    at i (browser.min.js:2)
    at browser.min.js:2

    so plz help me soon

Leave a Reply