Simple Weight Converter App With JavaScript & Bootstrap 4

  Рет қаралды 150,223

Traversy Media

Traversy Media

Күн бұрын

Пікірлер: 337
@inponderland
@inponderland 7 жыл бұрын
For people using the newest version of bootstrap, the classes to color the cards are 'bg-primary' , 'bg-success', and 'bg-danger'. They have done away with the 'card-success', etc. variants of the background classes.
@MrLuke3456
@MrLuke3456 6 жыл бұрын
Thanks a lot! I spent a good couple of minutes trying to figure out what I was doing wrong.
@MrLuke3456
@MrLuke3456 6 жыл бұрын
Thanks for the info! I helped my find what I was doing wrong.
@juthisarkeraka6336
@juthisarkeraka6336 6 жыл бұрын
thnks for the info! :D
@alexraab3022
@alexraab3022 6 жыл бұрын
Thank you
@sharifabahar6257
@sharifabahar6257 6 жыл бұрын
tnqs a lot for ur useful command.
@aleferr3ira
@aleferr3ira 7 жыл бұрын
Great tutorial!! For those who want to keep only two decimals: document.getElementById('gramsOutput').innerHTML = (lbs / 0.0022046).toFixed(2); document.getElementById('kgOutput').innerHTML = (lbs / 2.2046).toFixed(2);
@zmOe1
@zmOe1 7 жыл бұрын
thx
@MayankSingh-lg5wx
@MayankSingh-lg5wx 7 жыл бұрын
Alessandra Souza another way by using math.floor()
@aleferr3ira
@aleferr3ira 7 жыл бұрын
thanks, Mayank Singh!
@caroldanvers265
@caroldanvers265 7 жыл бұрын
good try but I still get a null value
@jorjlm83
@jorjlm83 7 жыл бұрын
For those doing this tutorial most recently, I believe there were some naming changes for bootstrap classes, so, the visual end result in some parts might not be the same. This padding on each card (Grams, Kilograms and Ounces) wasn't working, so I tried replacing by class="card-body" instead of "card-block" and it works.
@kingberz
@kingberz 5 жыл бұрын
geez thanks... i thought i was doing something wrong all the way xD
@stancedtaco
@stancedtaco 6 жыл бұрын
For anyone using the latest version of BS4, to get the colored background of the cards to display, change "card-danger" to "bg-danger" same goes with the other cards as well.
@gabytzugabytzu16
@gabytzugabytzu16 6 жыл бұрын
Thank you, man! You should go to the top with this comment. I scratched my head for like 5 minutes not knowing why tf my cards don't get the colored background. :))
@balance_andbliss
@balance_andbliss 6 жыл бұрын
And also card-body instead of card-block
@bhavin7485
@bhavin7485 6 жыл бұрын
Same here..@@gabytzugabytzu16
@bhavin7485
@bhavin7485 6 жыл бұрын
Thanks man...
@kingberz
@kingberz 5 жыл бұрын
@@gabytzugabytzu16yehh when are they going to be consistent all through
@efs76media
@efs76media 7 жыл бұрын
By a mile and a half, you are by far the best tutor on KZbin. Thank you so much for your videos and sharing your knowledge. Awesome stuff! :)
@onecarwood
@onecarwood 7 жыл бұрын
This will come in handy for weed conversions
@TraversyMedia
@TraversyMedia 7 жыл бұрын
LOL!
@munoha4438
@munoha4438 7 жыл бұрын
hahha nice dude
@aleferr3ira
@aleferr3ira 7 жыл бұрын
lol!
@raviverma8904
@raviverma8904 7 жыл бұрын
LOL
@sk8reality65
@sk8reality65 6 жыл бұрын
Lolllll
@tnmando
@tnmando 7 жыл бұрын
Just getting started with JS, but I really like the assignment idea. As a beginner it is great to see the different ways people approached the task.
@rubenverster250
@rubenverster250 6 жыл бұрын
check JavaScript30 out
@subvice2593
@subvice2593 5 жыл бұрын
This is a great tutorial. I am starting to build some real fluency with vanilla js concepts after this. Love the homework idea as well, going to try my hand at it for sure. Thanks for all the amazing content, Brad.
@cherulast7998
@cherulast7998 4 жыл бұрын
Hey brad u know that thousnds students are using ur tutorials i like ur small projects it gives me some idea how to work practically
@pickandhoop
@pickandhoop 6 жыл бұрын
Great Work Brad. Clear, fast and simple. As usual. Keep them coming!
@m.magdalena
@m.magdalena 7 жыл бұрын
Homework delivery temperature converter style! codepen.io/m2creates/full/prvqjp/
7 жыл бұрын
Melanie awesome work combining two tutorials. :) Can you do with a dropdown list for selecting initial input?
@TraversyMedia
@TraversyMedia 7 жыл бұрын
Awesome Melanie! Just awesome. Thanks for sharing
@m.magdalena
@m.magdalena 7 жыл бұрын
Strahinja Živković I thought about that but couldn't quite figure out how to dynamically fill just two output boxes (and having a drop-down with 6 output boxes seemed silly). Perhaps I'll poke it more today and see what I come up with!
@m.magdalena
@m.magdalena 7 жыл бұрын
Traversy Media thanks for the fun assignment that made practicing JS fun!
@tylerzey1229
@tylerzey1229 7 жыл бұрын
i know you.
@CodingPhase
@CodingPhase 7 жыл бұрын
This is a great quick tutorial for people to get their practice. Nice Job!!! Love seeing you in the video more!!!
@obedientzombie3080
@obedientzombie3080 7 жыл бұрын
This stuff is really good. Got no money to be a paetron, so here's a thubs up.
@TraversyMedia
@TraversyMedia 7 жыл бұрын
Thanks my friend
@cesarlara3974
@cesarlara3974 7 жыл бұрын
CAN YOU DO A VIDEO ON HOW TO DO A PORTFOLIO FOR BEGINNERS?
@praveenbadigerv
@praveenbadigerv 7 жыл бұрын
Short and simple yet so many things to learn. Thanks Brad. 🙌
@sangamadhikari8497
@sangamadhikari8497 7 жыл бұрын
Vanilla way of programming is ❤
@GAVIGHUMMAN
@GAVIGHUMMAN 6 жыл бұрын
With current bootstrap 4 cdn version "card card-primary" is now "card bg-primary". for future viewers
@ntakirutimanavalens4429
@ntakirutimanavalens4429 5 жыл бұрын
thx, i've been challeged with card card-primary but card bg-primary is so helpful!
@brendanmckeown27
@brendanmckeown27 4 жыл бұрын
Thank you!
@vaibhavmor1868
@vaibhavmor1868 7 жыл бұрын
Thanks @Travery Media! Keep these small projects coming!
@bardhan.abhirup
@bardhan.abhirup 6 жыл бұрын
Thanks a ton for your content! this stuff has been really helpful. I've been binging on your tutorials!
@glennkey3461
@glennkey3461 4 жыл бұрын
card-primary etc. is now bg-primary on bootsrap, for those wondering
@jinhoshin7923
@jinhoshin7923 5 жыл бұрын
card-primary, card-success and card-danger has changed to bg-primay, bg-success, and bg-danger currently. Also change card-block to "card-body" will look much more like his work.
@radiclelife
@radiclelife 5 жыл бұрын
I went with card-header to make the blocks a little skinnier. The card-body was too fat for me. Either way, it'll work!
@busyrand
@busyrand 7 жыл бұрын
Thank you so much for making this Very Beginner Friendly! I really appreciate your explanations.
@stevankostadinovic2250
@stevankostadinovic2250 7 жыл бұрын
I like how you are making app which looks good and not just text output on white background like in many other tutorials. I would like to see tutorial for currency converter with use of external api for getting current conversion rates, so it is always up to date.
@medi7573
@medi7573 7 жыл бұрын
This is it bro it is alot better now please make all next tutorials same way i mean live reloading and split screnn into two parts like this we can see what is created on the page while you are typing :D
@FULLUPE1
@FULLUPE1 5 жыл бұрын
Thanks so much it was a great tutorial .. i'm a beginner of js ...have added little to this which is " when lbs == 0 then the output is hidden again " thanks once again
@M3TALISB3AST
@M3TALISB3AST 7 жыл бұрын
Do more of these I'm really digging these vanilla JavaScript projects.
@rubenverster250
@rubenverster250 6 жыл бұрын
check JavaScript30 out
@rufus9821
@rufus9821 7 жыл бұрын
awesome vid as usual. best 17 minutes i have spent
@projectDominic
@projectDominic 6 жыл бұрын
Great practice changing some of the classes from alpha Bootstrap to 4.1 and of course they were already pointed out in the comments! Also used some mx-auto from Brad's Bootstrap course Leaving background white looks better
@dndnegy73
@dndnegy73 5 жыл бұрын
finally I made simple app even if its a small one it worked and the bigger to come
@lawrencenkadi8926
@lawrencenkadi8926 5 жыл бұрын
That was very helpful for a beginner like me. It was very clear and easy to follow. Yeah! I'm happy with that. Thank you
@lukkash
@lukkash 4 жыл бұрын
Additionally formatting with toFixed and also names on the left and values on the right. I love converter projects :)
@daviskane7904
@daviskane7904 7 жыл бұрын
Thanks Brad - another dope tutorial where I learned a ton!
@lukkash
@lukkash 4 жыл бұрын
or with any framework you can make a converter (e.g. pounds, grams, ounces, troy ounces) where all other fields recalculate themselves when you input a number into one of them. A Converter is a quite interesting project when you start learning frameworks.
@ronaldjohnson4470
@ronaldjohnson4470 7 жыл бұрын
Very nice tutorial Brad, thank you.
@andreaskaaej
@andreaskaaej 3 жыл бұрын
Short and concise video, great explanations. Thanks 👍🏼
@simplex2168
@simplex2168 6 жыл бұрын
For the people who are getting stuck at the colors: The bootstrap class has been changed to bg-primary not card-primary.
@GilFavor101
@GilFavor101 5 жыл бұрын
Only thing wrong with this video is that there isn't a link in the description for another video just like this : ) Great video here, thanks for doing this.
@dineshrout2527
@dineshrout2527 4 жыл бұрын
This was not a difficult project, but your teaching made it interesting. I'm going to make it in css now.🙂
@MushaGH
@MushaGH 7 жыл бұрын
you make me fall in love with web development
@scottyhall4215
@scottyhall4215 6 жыл бұрын
I do wish you would slow down some for those that cannot type so fast and are trying to learn. Keep in mind you are teaching people and it would be nice to breathe every now and then and take in what has been done. Otherwise I might as well just copy and paste and be done with it.
@sriramrajagopal134
@sriramrajagopal134 6 жыл бұрын
Play the video at 0.75x or 0.5x speed
@rymbouchetara1066
@rymbouchetara1066 5 жыл бұрын
Cam SB said : "For people using the newest version of bootstrap, the classes to color the cards are 'bg-primary' , 'bg-success', and 'bg-danger'. They have done away with the 'card-success', etc. variants of the background classes." Also for card-block use card-body !
@brucelee7782
@brucelee7782 6 жыл бұрын
Hello Sir may I ask what does the method .target do (12:13)? Can I just use e.value instead?
@Vlusion
@Vlusion 7 жыл бұрын
Was in coding spree so picked a new 'coding theme' screensaver. Same like your banner I now see :)
@sigplayer112
@sigplayer112 5 жыл бұрын
you can add if(document.getElementById('lbsInput').value.length === 0){ document.getElementById('output').style.visibility = 'hidden'; } to hide it from displaying zeros if input is empty
@justdarkjazz4020
@justdarkjazz4020 5 жыл бұрын
Add it where exactly? I tried it and it kind of fucked up my code.
@lulualmohtarif
@lulualmohtarif 7 жыл бұрын
thanks alot brad, that was so great and clear from morroco
@JBuchmann
@JBuchmann 7 жыл бұрын
Great tutorial, thanks! I think it would be cool if you could show how to do the same/similar app in multiple technologies... for example Angular, React, and others (this vid is already vanilla js). It would be valuable to see the different approaches to the same problems in each technology.
@adamklepacz6322
@adamklepacz6322 7 жыл бұрын
BOOTSTRAP 4 UPDATE: For those who are watching after August 2017: change bootstrap card-block class to card-body class
@haroldw2823
@haroldw2823 7 жыл бұрын
Nice Job Mate, easy to follow
@MrDTTV
@MrDTTV 7 жыл бұрын
this was awesome! keep the content coming!
@Suneriins234
@Suneriins234 4 жыл бұрын
Weight Converter Grames Kilogrames Ounces ' document.getElementById('output').style.visibility = 'hidden'; document.getElementById('IbsInput').addEventListener('input', function(e){ document.getElementById('output').style.visibility = 'visible'; let Ibs = e.target.value; document.getElementById('gramsOutput').innerHTML = Ibs/0.0022045; document.getElementById('kgOutput').innerHTML = Ibs/2.2046; document.getElementById('ozOutput').innerHTML = Ibs*16; });
@CreatingAlong
@CreatingAlong 5 жыл бұрын
I thought I might mention "e.target.value" returns an error, had to change it to "event.target.value" to get an output.
@phethomberg9669
@phethomberg9669 6 жыл бұрын
Awesome video man !! Pls do more this type of video
@skrezwan12
@skrezwan12 6 жыл бұрын
Good for practicing Js and bootstrap as well.
@pikachu5223
@pikachu5223 7 жыл бұрын
Thanks Brad! Love you
@0the0ambient0
@0the0ambient0 7 жыл бұрын
As always, great tutorial
@sdborn8667
@sdborn8667 7 жыл бұрын
Thank you, Brad! Nice video!
@hirephpdevelopers3840
@hirephpdevelopers3840 7 жыл бұрын
Very informative tutorial Brad, thank you.
@americomondragon6973
@americomondragon6973 3 жыл бұрын
Excelente video, es el mas sencillo que he econtrado, muchas gracias!
@medhamohanty5270
@medhamohanty5270 3 жыл бұрын
Great informative video. Very helpful.
@tudorb.2849
@tudorb.2849 6 жыл бұрын
Anyone can tell me how is the plugin for HTML shortcuts called in visual studio code ? min 2:24.Thank you
@joydas1685
@joydas1685 7 жыл бұрын
Good video ;) got some knowledge regarding bootstrap and javascript
@dxdMyBroadcast
@dxdMyBroadcast 7 жыл бұрын
Nice one) I'd add a check for typeof === 'number' and error handling.
@dusski1
@dusski1 7 жыл бұрын
You don't need that because you're using a number input.
@ThisIsJ0nny
@ThisIsJ0nny 7 жыл бұрын
Hey man, would be great to get your opinion / some tutorials on sails. Keep up the awesome work! (Also love the clicky keyboard, not to loud, not too quiet)
@TraversyMedia
@TraversyMedia 7 жыл бұрын
Thanks. It is actually one of the quieter ones I could find. I tend to smash the keys when I code. Off video I use a cherry mx red switch mechanical keyboard but it is way too loud for recording
@FlashMoney-ps8ef
@FlashMoney-ps8ef Жыл бұрын
Great tutorial, I would like to know how to make with cross-references , in order that when I set the value of the ounces (or the kilograms or grams) the program gives me the original pounds value as well... Thanks for this video
@samshanmukh
@samshanmukh 7 жыл бұрын
nice idea of giving homework for community.
@randombiketrips3296
@randombiketrips3296 7 жыл бұрын
Is there a reason why you use Atom as opposed to VSC or Sublime? I really like the way you teach because it's really clear and simple, btw.
@spongebobspongebob24
@spongebobspongebob24 7 жыл бұрын
wow. Your new intro looks nice.
@suatarancak7206
@suatarancak7206 5 жыл бұрын
weight converter tools online : calculatorsnew.com/content/weight-converter/104
@thinsmoke7679
@thinsmoke7679 4 жыл бұрын
How do you centralize the input pounds in the middle. Something has changed with bootstrap since you released this. The box covers the entire webpage
@nagahumanbeingzooofparticl8836
@nagahumanbeingzooofparticl8836 6 жыл бұрын
Thank you so Much Brad..🥇🥇🥇
@nikolap99
@nikolap99 7 жыл бұрын
I know I'm late, but how would this be done in React? I'm just starting to learn and want to learn by making these little projects, so should I make just a Card component etc. or should this be done different way?
@jimdart8219
@jimdart8219 6 жыл бұрын
I love Brads Tutorials. But now that boostrap 4 is stable, what a pain trying to get even the HTML to work right. Even had VSCode give me errors on the tags for the link to Bootstrap saying they were special and had to be escaped. Could not get the H1 to center and the form-control-lg, well that was md at best. Oh well on to bigger and better. Thanks Brad your the best.
@galbalazs87
@galbalazs87 7 жыл бұрын
Awesome, as always! Thanks!! :)
@kaktotak547
@kaktotak547 5 жыл бұрын
Your videos are great!
@ajazmiah
@ajazmiah 7 жыл бұрын
If I do the homework and change the style a little...will I be able to use it as my own project ND show it to employers?
@matteolinux9467
@matteolinux9467 7 жыл бұрын
very clear and nice video! thanks
@TraversyMedia
@TraversyMedia 7 жыл бұрын
Thank you :)
@Princess_kitty14
@Princess_kitty14 6 жыл бұрын
why getElementById and not querySelector? also, is not easier to store the dom in a var? it can save a little typing
@amitgogna2701
@amitgogna2701 7 жыл бұрын
Thanks brad ,pls make some videos on bootstrap dashboard with some charts and bars in them
@bryanbolanos6557
@bryanbolanos6557 7 жыл бұрын
Awesome tutorial!!
@TheNanoWeb
@TheNanoWeb 7 жыл бұрын
If you enter 0, then it shows the result. We need to add some statement for that also.
@caroldanvers265
@caroldanvers265 7 жыл бұрын
Nice project, but it will only calculate grams to lbs and nothing more. Line 66 comes out null for some reason. document.getElementById('output').innerHTML = lbs/2.2046; document.getElementById('output').innerHTML = lbs*16;
@mrgreggles998
@mrgreggles998 7 жыл бұрын
This is great; interesting to see you use Bootstrap 4. Hopefully it'll be operational in the foreseeable future. Brad, any specific reasons why you use Atom over Visual Studio Code?
@TraversyMedia
@TraversyMedia 7 жыл бұрын
Honestly Gregg, I love both and I am torn. What I have been doing lately is using Atom for frontend html/css/vanilla ES5. And vscode for anything I use the terminal with. I LOVE the integrated terminal with Git Bash. I am thinking about moving completely away from Atom
@RABWA333
@RABWA333 7 жыл бұрын
Thanks, nice video , informative 👍
@ghnanax
@ghnanax 7 жыл бұрын
Hello Brad. Would you recommend windows over mac? I know Mac is the most sort after due to Linux etc. However, since you are knowledgeable in a number of languages what's your take on this? Thank you.
@moycs777
@moycs777 7 жыл бұрын
Very good exampleee, thanx!
@rajatexplains
@rajatexplains 7 жыл бұрын
Very nice video Brad..however, I'm having a hard time bringing in colors on my cards. It seems like classes- "card-primary" and others are ineffective
@rajatexplains
@rajatexplains 7 жыл бұрын
Thanks :)
@brokiama
@brokiama 7 жыл бұрын
Will you make a JS crash course? Didnt see it in your channel, you're a great teacher BTW.
@TraversyMedia
@TraversyMedia 7 жыл бұрын
I have a JavaScript Fundamentals video but I will be doing an updated one soon
@saurabhvavekar4394
@saurabhvavekar4394 5 жыл бұрын
Please add series of small pure javascript projects
@DEEPANKUMAR2
@DEEPANKUMAR2 7 жыл бұрын
Hi Mr.brad... Please create a playlist or a short video to set up web assembly in windows. I tried my all possibilities I thnk so, ending up with same error : CMake invocation failed due to exception! Please help me
@obelix7349
@obelix7349 4 жыл бұрын
How to take two different elements from two different IDs and create a common function using both inputs? 1st element would be number input and second input would be selection drop down? Can someone help me?
@pallavigondane5977
@pallavigondane5977 6 жыл бұрын
Uncaught TypeError: Cannot set property 'innerHTML' of null at HTMLInputElement. i am getting this error in the last line of my code in the script part
@harissaleem8688
@harissaleem8688 4 жыл бұрын
Can you please make a video on this concept recently i learned java, But in javascript it is difficult for me to understand that suppose we have let a = "Brad".length; then console .log(a) result will be 4 ; so, how we are accessing the dot length thing or maybe like let a = "Brad".toUpperCase(); how this function we are calling because " Brad " it is not a reference variable because in java we use the reference variable them put dot to call any thing inside the object of that class in javascript where is this coming from ???? Please make a video that will be all for me ane it will others also to build concept .
@ajazmiah
@ajazmiah 7 жыл бұрын
So if do with without e.target it wouldnt update automatically? i will need a button?
@azizatawfiq828
@azizatawfiq828 5 жыл бұрын
very nice tutorial ..thanks alot
@MLievens
@MLievens 5 жыл бұрын
bg- primary bg-success- bg-danger and instead of card-block: card-header
@duke4279
@duke4279 4 жыл бұрын
thank you sir this is awesome content :)
@dndnegy73
@dndnegy73 5 жыл бұрын
I don`t know why the`re sticking to the left of the page not in the middle even after offset?
@TheFallinforyou
@TheFallinforyou 7 жыл бұрын
How would you do this with a click event instead of real time results?
@siro8472
@siro8472 7 жыл бұрын
he makes these shortcuts eg .container and it makes automatically the class with what?? emet?? what is the name?
@mendisterenfeld2668
@mendisterenfeld2668 7 жыл бұрын
How do I make something that if it's not a number that the user puts in then there is an alert or something like that..
JavaScript Higher Order Functions & Arrays
34:56
Traversy Media
Рет қаралды 991 М.
Weight Converter Javascript | HTML, CSS & Javascript
13:03
Coding Artist
Рет қаралды 3,1 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
How I got my first internship (software engineering)
6:41
Frying Pan
Рет қаралды 576 М.
I built the same app 10 times // Which JS Framework is best?
21:58
Fireship
Рет қаралды 2,6 МЛН
Zelensky Announces Talks with Russia / End of Martial Law?
13:55
NEXTA Live
Рет қаралды 1,1 МЛН
The Importance of Specialization in Coding
7:13
Traversy Media
Рет қаралды 243 М.
15 Myths & Misconceptions In Web Developement
16:51
Traversy Media
Рет қаралды 24 М.
Animate Your Font Awesome Icons With JavaScript
18:52
Traversy Media
Рет қаралды 98 М.
AJAX Crash Course (Vanilla JavaScript)
1:09:43
Traversy Media
Рет қаралды 730 М.
Сборник Эксклюзивов 2024 - Уральские Пельмени
1:33:24
Уральские Пельмени
Рет қаралды 1,3 МЛН
Modern Image Gallery With ES6 Vanilla JavaScript
22:36
Traversy Media
Рет қаралды 93 М.
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН