Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript and the DOM (Retiring) Making Changes to the DOM Getting and Setting Text with textContent and innerHTML

Gareth Partridge
Gareth Partridge
13,421 Points

Working in the Console

Why would you work and apply changes in a console ? what is the purpose of the console ? when making changes to a website through the console does it save those changes ?

or is the console just being used for teaching purposes ?

3 Answers

devina christabela
devina christabela
12,526 Points

If console by you mean the browser console, you can test manipulating DOM / using javascript on the console browser.. You don't need to be afraid something broken during your changes using console, you can always revert it back by refresh the browser window..

Gareth Partridge
Gareth Partridge
13,421 Points

So the console is used for testing purposes ?

devina christabela
devina christabela
12,526 Points

For me, I only use console for testing, tracing error, and see XHR Request..

Sean T. Unwin
Sean T. Unwin
28,690 Points

I would say that, yes, the console is primarily for testing/experimenting. It is a great resource when creating front-end content.

console.log() all the things you have a need to see what your data (e.g. variables) are at certain moments in the page's activities.

Setting breakpoints on your code with the Debugger tab is also very handy, especially for watching variables, and stepping through your code as it executes.

The other tabs, such as Network, Performance, Memory (depending on browser but similar naming) are very handy for checking various aspects of a page or SPA (Single Page Application).