From the course: JavaScript Code Challenges: Creating Web Apps

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Overview of the necessary JavaScript concepts

Overview of the necessary JavaScript concepts - JavaScript Tutorial

From the course: JavaScript Code Challenges: Creating Web Apps

Overview of the necessary JavaScript concepts

- [Instructor] Before we start coding, let's go over the JavaScript concepts you'll need for this project. Nothing too fancy. We're keeping it beginner friendly. Here's what you'll see in action. First up, DOM Access. DOM stands for Document Object Model. We use document.getElementByID to grab our HTML elements like the timer and the buttons. This is how we connect our JavaScript to the actual page. Like this. Here we have a button that says click me, and then we're going to say in our JavaScript constant button, so that's where we're going to store it in equals document.getElementByID my button that's equal to the ID, and then we can go ahead and do things with it. In this case, we're logging the text content, which is equal to click me because that's the inner text of the button. The next thing we need to write are our functions. We use functions to organize behavior such as starting, pausing, resetting the timer and updating the display. Here's an example of a basic function. So in…

Contents