JavaScript and the DOM

Treehouse
Course Summary
JavaScript lets you create interactive web pages which can respond to a user's actions. In this course, you'll learn how to bring web pages to life using the power of JavaScript.
-
+
Course Description
About this Course JavaScript lets you create interactive web pages which can respond to a user's actions. In this course, you'll learn how to bring web pages to life using the power of JavaScript. What you'll learn
- What is the DOM?
- Making Changes to the DOM
- Responding to User Interaction
- Travelling Through the DOM (Traversal)
About the Teacher
Joel is a web developer, as well as an author and teacher of JavaScript content at Treehouse. Joel lives in Portland, Oregon with his wife and two-year-old daughter.
-
+
Course Syllabus
The Browser Environment
The environment that JavaScript runs in — like a browser, or a server, or even an embedded computer — has a fundamental effect on what it can do. In this stage we'll explore the browser environment, and see how JavaScript can change a webpage right before our eyes. 5 steps- Welcome and Overview 4:22
- Thinking Globally 6:42
- What is the DOM? 2:07
- Recap 1:37
- The Browser Environment Review 5 questions
Getting a Handle on the DOM
The first step of making a web page interactive is grabbing ahold of elements you want the user to interact with. This is called selection. There are a number of ways to select elements on a web page. Let's explore those you are likely to use most often. 11 stepsMaking Changes to the DOM
Once we've selected an element in the DOM, we can read or affect it. We can replace or change the display of text, for example. Or we can create new nodes and insert them into the DOM. Let's learn about and get some practice with some of these actions. 11 stepsResponding to User Interaction
Now we'll get to "teach" an element to behave a certain way when a user interacts with it. For example, we could have a form field turn red if a user enters invalid text. Or a menu could appear if a user clicks on the menu bar. Let's look at these and other behaviors we can set up on a web page. 10 stepsTraversing the DOM
You have your hands on one element, but you want to grab another one nearby. You could go all the way back out to the document and call to it from there, but chances are your node already has a reference to it. Let's learn how to get around in, or traverse, the DOM. 11 steps