JavaScript for Beginners #7 - If, Else If, Else

preview_player
Показать описание
This JavaScript tutorial for beginners covers if , else and else if statements. These can be used to execute code based on conditions that occur. In this video we run through an example where we change the color of text based on the users input.

◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python

◾◾◾◾◾◾

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

Tags:
- Tech With Tim
- JavaScript for beginners
- JavaScript If, Else, Else If
- If, Else, Else If JavaScript
- JavaScript Tutorial for Beginners

#JavaScript #JS
Рекомендации по теме
Комментарии
Автор

When see Tim's video:
1. Like
2. Start watching

bekhruzniyazov
Автор

I started learning JavaScript last month and these videos are so helpful! Thank you Tim, please keep these series longer!

desislavaandreeva
Автор

I'm from Colombia and I have been trying to get inside this world for around 5 months, it seems these videos are going to be my way in!

valeriaalfonsotobon
Автор

I just changed it to this:

function pressed(){
var text =
= text;
}

this way, no matter what color you input it will change it to that color.

brianyildirim
Автор

this series of tutorials + google searches+ taking notes + trying different things as you follow the tutorial = best way to learn

arcei
Автор

This is what I've been looking for, a tutorial with actual examples. Thank you so much.

sarkasbooks
Автор

Wow, I'm back after 2 months break from learning JS and came here to refresh the basics, and I actually learned a new thing! (that I can use more than one If in a single function to check stuff simultaneously) Dope!! thanks

jakubnowak
Автор

What about getting the value from the input and adding it on the style.color value? More eficient and clean in my opinion,
But any way, this was made not to be eficient but to make it clear to people who are learning.
Great job btw! Learning a lot the work that you put in making these videos.

sfraction
Автор

You have a great talent for teaching. Thank you for your contributions.

marc
Автор

Nice video tim!

And later on how do i do the color thing with a aray?

vortex
Автор

you're better at teaching code than my uni lecturer

nqzy
Автор

Thank you for this video. I like the fact that I can get some relief from shitty video production and bad content. Peace :)

francislambert
Автор

This is an awesome tutorial
Please post a video on tutorial of c sharp . Please!!!

dhanavignesh
Автор

Hey Tim, thank you so much this was really helpful but I have a question :
Let's say i want a user who has typed "red" to be redirected to a website and a user who typed "blue" to be redirected to another, how would i type the code?

iminshot
Автор

Thank you for this useful video, but i have a question what if we want to make the h1 tag gets the color that's typed for example if the user inputs purple or orange the h1 tag color get changed, the problem is if we keep typing the same code for multiple times it would be boring, and thank you !

yassser
Автор

😂 I'm so dumb I was having an issue with the colors not changing when I added the 'else if' just because I forgot to close the bracket on the first 'if'

one_punchline
Автор

what if I want to show a text saying red/green/blue how do I do that ?

doctorOREL
Автор

I learning how to not mess up the video like u did in 5sec

sdprolearning
Автор

If you're like me and got stuck at 4:00 it's because of line 10:

var text =

for some f'ing reason you must assign it sans the .value part:

var text =

and then call the value via text.value:

if(text.value === "red"){

Hopefully I save you the 20 minutes it took me to figure out why it wasn't working >:(

stevesmith
Автор

Who was dying when they saw the else not being separated from the curly brace, at 5:22 or something

Sciencedoneright