Weight Converter debugging

  You are currently not logged in. You can view the forums, but cannot post messages. Log In | Register

03-Sep-17 10:30
Hello. I was making Weight Converter (using tutorial) that should convert pounds to grams, kilograms and ounces and it was working yesterday. But today it just converting grams.
Here is a code:

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
body {
margin-top: 70px;
background: #333;
color: #fff
<title>Weight Converter</title>
<div call="container">
<div class="row">
<div class="col-md-6 offset-md-3">
<h1 class="display-4 text-center mb-3">Weight Converter</h1>
<div class="form-group">
<input id="lbsInput" type="number" class="form-control form-control-lg" placeholder="Enter Pounds">
<div id="output">
<div class="card card-primary">
<div class="card-block">
<h4>Grams: </h4>
<div id="gramsOutput">

<div class="card card-success">
<div class="card-block">
<h4>Kilograms: </h4>
<div id="kgkOutput">

<div class="card card-danger">
<div class="card-block">
<h4>Ounces: </h4>
<div id="ozOutput">

document.getElementById('output').style.visibility = 'hidden';
document.getElementById('lbsInput').addEventListener('input', function(e) {
document.getElementById('output').style.visibility = 'visible';
let lbs = e.target.value;
document.getElementById('gramsOutput').innerHTML = lbs/0.0022046;
document.getElementById('kgOutput').innerHTML = lbs/2.2046;
document.getElementById('ozOutput').innerHTML = lbs*16;
06-Sep-17 08:29
"it was working yesterday. But today it just converting grams."

And what changed in between those times?

So long, and thanks for all the fish.

New posts
Old posts

Follow Elated