To get the most from my lecture, please create a newCodepen and code along with me!
Don’t just watch me code! 👀
If necessary, pause, slow down, or speed up the video!
For students who prefer reading over watching, you can find nice transcripts of all my videos (with lots of diagrams and side notes) at my Medium.
MediumTextbook:transcripts+diagrams+sidenotes
At the end of each lecture, you are expected to code on your own. If you can do all three (read, watch, and codealong with me), you will have no problem at all! 😎
WatchVideo+CodeAlong+ReadTextbook=A+Student!
Lecture
Hello World! 👋
Since Codepen is where we will spend most of our time, let’s go over it again — but this time in more detail.
As the name suggests, this first window (top left) is where we write our HTML code. This second window (middle left) is where we write our CSS code. And this third window (bottom left) is where we write our JavaScript code.
Top Left: HTML Window
Middle Left: CSS Window
Bottom Left: JS Window
These three codes get rendered by the browser into this window (top right) for the users of our website to see and interact with.
TopRight: UI Window
Finally, this Console window (bottom right) is a special window for developers to easily interact with all the codes.
BottomRight: Console Window
In other words, this window (top right) is the User Interface (UI) window for the users, whereas this window (bottom right) is the “UI” window for the developers.
UI Window => Users
Console Window => Developers
Hello World
Let’s say “Hello” to the World which coders like to do at the start of a project.
HTML Window:
Hello World
In the HTML, we can simply write Hello World, and it will appear in the UI window for our users to see.
UI Window:
Hello World
That’s simple and all, but what if we want to give it a color?
Our data, in this case, is the text Hello World. To style it, we need to give this data more structure.
We can do this using HTML tags.
HTML Window:
<p>Hello World</p>
For example, we can use the p tag which stands for the paragraph tag.
Notice that these tags do not appear in the UI window.
UI Window:
Hello World
We add these tags so that in the CSS window, we can select it like this:
CSS Window:
p {
}
Then, inside the curly braces, we can give it a color of orange:
CSS Window:
p {
color: orange;
}
Also, we can select this tag using JavaScript like this:
JS Window:
document.querySelector("p")
To verify that this tag was indeed selected, we can enter the same code in the Console window:
Again, we’re using MDN because it’s a best practice amongst Senior Engineers. Therefore, we should begin familiarizing ourselves with MDN as early as possible.
We apply HTML tags to our texts to give them structure.
That way, in our CSS code, we can select the contents inside our tags using a CSS ruleset like this:
By applying tags to our HTML code, we can select those tags using CSS code and JavaScript code.
In CSS and JavaScript, tags are referred to as elements. Lesson 3 will explain why!
To select any HTML element using JavaScript, we can use the following JavaScript code:
document.querySelector(selectors)
For the selectors, we can type the name of our element inside double quotes:
document.querySelector("p")
Keep in mind that HTML and CSS code are not case-sensitive, but JavaScript code is.
HTML/CSS: p = PJavaScript: p ≠ P
For now, just focus on remembering this syntax. As we progress through the course, your understanding will deepen with practice.
Concept Quiz
Take my Programming Concept Quiz to check your understanding! For every correct choice, you will earn SW Coins which you can redeem for coupons towards the purchase of any of my Udemy courses!
Check out my Interactive Coding Exercises to put to practice what you have learned! There, you will also find interactive hints to help you understand each line of code. Likewise, for every correct solution, you will earn SW Coins which you can redeem for coupons towards the purchase of any of my Udemy courses!
Review what you have learned by playing my Syntax Flashcard Game! These flashcards are designed to help you commit to memory all the newcodesyntaxes you learned in this lesson.
Now that you have experienced your first coding exercise, I would like to mention some good habits for you to get the most out of these coding exercises.
Step1: Pass Quiz = at least 80% Correct + 90% Confidence
My quizzes are great for checking your understanding. If you’re able to score above 80% and you’re at least 90% confident in your answers, you’re ready to attempt my coding exercise! If not, rewatchmy lectures again.
Step2: Attempt Coding Exercise Alone
Try your best to solve the problems yourselfbefore checking my solutions. If you’re stuck, go back and rewatch my lectures pertaining to that problem.
Step3: If Stuck => Rewatch Lectures
The solutions can be found somewhere in those lectures!
Tip: If necessary, you can lower the speed in the video settings!
Step4: If Still Stuck => Check Solutions
If you’re still stuck, then you may check my solutions.
If problems are too easy => Check Solutions anyway
On the other hand, if the problems are easy for you, and the solutions are obvious, check my solutions anyway. My approach may contain insights that you might not have realized.
Tip: If desired, you can increase the speed in the video settings!
If you think your approach is better => Shareon Discord Server
If you think your approach is better,please consider joining my Remote Cohort Program and sharing your insightsinour private Discord Server with your fellow students.
Since you’re learning on your own without any supervision, it’s easy to cheat or skip these coding exercises. But if you can commit to doing them properly, you will definitely learn and grow a lot throughout this course.
Unit 1
You have completed the firstlesson of this Unit!
Congrats! 🎉
As you have witnessed, we learn allthree web languages (HTML, CSS, and JavaScript) together in parallel to help deepen our understanding of their interrelationships. As such, they are like the starmusicalinstruments of an orchestra!
Hence, the Title of Unit 1: HTML/CSS/JS Orchestra 😁
As the Title implies, in this Unit, we simply focus on introducing the starinstruments of our orchestra and how they interplay! As the course progresses, each star instrument performs a concerto, culminating in a grand symphony that harmonizesall three instruments. To actualize my analogy, commit yourself tofinishingthisentirecourse! 💪😄
In the next lesson, we will learn about the Console windowin more detail. We will learn how to log messages to the Console window from the Console itself and also from JavaScript using the log command. Master this foundational skill and you’re off to a great start!
When you use my referral link above 👆 to become a Medium member, all proceeds will be donated towards the construction of the Silicon Wat Campus for children in Ukraine and Cambodia ❤️