- [Narrator] To start this project let's take a quick look at the files we'll be working with. Index.html has some standard components. Here we have a H1 heading at the very top followed by a description of what this app is all about. Then there's a container that holds the test text. This is the text that needs to be matched down here in the text area. And finally we have a timer area, and a button that says Start over. Right now, none of this stuff works. Timer is not running, nothing happens when I type, and I can click on this button all I want, nothings happening.
That's fine, we're not going to make any changes to the HTML or the CSS of this. This is exactly what the app will look like when it's done. What we will do is write a bunch of Javascripts to hook into the different features. Let's take a quick look at the backend to just see how everything stitches together. Here in index.html we have a header that is the header section. We then have a main that holds all the main content. And inside the main there's the article at the top that has the intro content. None of this is relevant to what we're doing.
The section with the class test-area is where the actual test happens. And here we have first a div with the id origin-text, that contains a paragraph. The contents inside this container is what we'll use to match against what the user is typing in. So whatever text you put here where it currently says The text to test, will be the text that the user needs to type in. Then we have the test-wrapper. Here we have textarea with the id test-area that we will retrieve content from. Here there's a section with id clock that contains a div with the class timer.
Currently it's just hard-coded to 00:00:00, this is the starting state of the timer. And then finally we have a button with the id reset, that says Start over. Like I said, we're not touching any of this. You can if you want to change the text inside this origin-text area, but that's the only thing you'll need to make any changes to. In script.js I've just set up constants that map to the different components within index.html. So here we have testWrapper which maps to the test-wrapper. We have testArea which maps to test-area.
originText maps to origin-text p, so that is the inner html of the paragraph that sits inside this origin text box here. resetButton maps to the id reset. And finally theTimer maps to timer. In addition, I've added comments in script.js that list out all the different things we need to do to get the script to work. So if we start at the bottom we add event listeners for keyboard input and the reset button. That's just so that we can actually interact with the app. Then, when we interact with the app, several things will happen.
We'll start the timer, then we will actually run the timer up here. Then we will match the text entered with the provided text on the page. And finally there's a reset button to reset everything. Alright, those are the structural components, now let's work through this app step by step to add in all the features and get it to work properly.
Author
Updated
4/1/2019Released
5/17/2017Through practical examples and mini-projects, this course helps you build your understanding of JavaScript piece by piece, from core principles like variables, data types, conditionals, and functions through advanced topics including loops, closures, and DOM scripting. Along the way, you will also be introduced to some ES6 and the basics of JavaScript libraries.
- What is JavaScript?
- Working with data
- Using functions and objects
- Working with JavaScript and the DOM
- Changing DOM elements
- Handling events
- Working with loops
- Making images responsive using markup
- Troubleshooting code
- Validating functionality
- Minifying JavaScript
Skill Level Beginner
Duration
Views
Related Courses
-
Introduction
-
Welcome1m 7s
-
-
1. JavaScript: An Introduction
-
What is JavaScript?2m 38s
-
-
2. The Basics
-
Introducing the browser console10m 31s
-
3. Working with data
-
Data types in JavaScript4m 2s
-
Arrays2m 20s
-
4. Functions and Objects
-
Functions in JavaScript3m 28s
-
Build a basic function3m 29s
-
Anonymous functions5m 11s
-
Variable scope3m 17s
-
ES2015: let and const6m 12s
-
Make sense of objects3m 19s
-
Object constructors6m 16s
-
Closures8m 11s
-
-
5. JavaScript and the DOM, Part 1: Changing DOM Elements
-
Access and change elements4m 33s
-
Access and change classes3m 45s
-
Access and change attributes4m 53s
-
Add DOM elements6m 56s
-
6. Project: Create an Analog Clock
-
Use CSS to move clock hands3m 49s
-
7. JavaScript and the DOM, Part 2: Events
-
What are DOM events?1m 31s
-
Some typical DOM events1m 59s
-
Add and use event listeners6m 51s
-
-
8. Project: Typing Speed Tester
-
Rundown of HTML markup2m 58s
-
Build a count-up timer5m 56s
-
Add a reset button5m 3s
-
-
9. Loops
-
Loops3m 37s
-
Looping through arrays4m 7s
-
Break and continue loops7m 9s
-
-
10. Project: Automated Responsive Images Markup
-
Project breakdown1m 55s
-
Rundown of project setup3m 26s
-
-
11. Troubleshooting, Validating, and Minifying JavaScript
-
Troubleshooting JavaScript7m 20s
-
Online script linting5m 57s
-
Automate script linting8m 24s
-
Online script minification2m 50s
-
Automate script minification2m 24s
-
12. Bonus Chapter: Ask the Instructor
-
What are arrow functions?3m 11s
-
What does the % symbol do?3m 47s
-
-
Conclusion
-
Next Steps1m 55s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Rundown of HTML markup