From the course: JavaScript: Enhancing the DOM (2013)

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Testing JavaScript commands with the console

Testing JavaScript commands with the console

From the course: JavaScript: Enhancing the DOM (2013)

Start my 1-month free trial

Testing JavaScript commands with the console

In the last movie, we learned how to work with the developer tools. And how to activate the console. In this movie, we're going to focus just on the console. So the quickest way to get to the console is by hitting Command+Option+J. And I'm using a Mac right now. On a PC, Command is usually Ctrl, Option is usually Alt. So this would be Ctrl+Alt+J. It might be more convenient, though, to call the console within the elements panel. So, you can do that by clicking on the Elements panel and then hitting the Esc key. That toggles the console on and off. The DOM can be accessed by using selectors. So if I just type in document, it selects the entire DOM and I can click on it, just like I can with the Elements tab. The DOM has added completion, so as soon as I start typing doc, it's suggesting that I probably want the document, so I can hit Tab and then Return to execute that command. If you type in a period after document, then it's going to select from this list of options, all the methods…

Contents