Current section: Hello World in JS 22 exercises
lesson

Intro

Loading lesson

Transcript

00:00 To do a hello world in HTML is really not a whole lot of work. You have an HTML body, and then you've got a div, hello world, or maybe you want to do a p tag or whatever. But the point is, getting hello world on the page is really simple with HTML, and it's really not that much more complicated with JavaScript. And understanding how to interact

00:18 with the page using JavaScript is your first entry into creating dynamic and interactive user experiences on the web. So to get JavaScript on the page, you can have a script tag, and inside of the script tag, you can have JavaScript. Typically, you're going to want to write that

00:36 in a separate file, so you have a source right here that points to some URL. But for this first couple of exercises, we're gonna keep it as simple as possible. Everything is in one file, and eventually, we'll add a bunch of other files. So the thing that we're gonna be focusing on

00:53 in this exercise is the document and creating elements, and appending those elements to other elements. And so that's what we're gonna be working on through this exercise is modifying the document object model, which you can find on MDN. If you search MDN.io slash DOM,

01:13 that's DOM, document object model, then you can read all about that. That's this whole big thing that we have had since the beginning of JavaScript on the web, being able to interact with the DOM. And it can be a little bit messy, but that's why we have things like React.

01:31 Modern JavaScript and modern DOM is actually quite nice. And so you can build some pretty fantastic user experiences just using the DOM directly. But there are a lot of things that React offers us that make us want to move over to React. But that is not what we're doing in this exercise. We're just gonna be focusing on the DOM

01:51 so that you get an understanding of the building blocks that React uses to create the experiences that we're looking for. And then from there, we'll have a much more solid foundation to build upon when we get into React. So for this exercise, let's learn about the hello world in JavaScript using the DOM.