What is the console used for?
A Console is a sandbox that can be used to log information as part of the JavaScript development process, as well as allow you to interact with a web page by carrying out JavaScript expressions within the page’s context. Essentially, the Console provides you with the ability to write, manage, and monitor JavaScript on demand.
How do you open the Console in Google Chrome?
There’s two way you can open the console in Google Chrome; 1st is through the menu at the top-right of your browser & or the shortcut using the keyboard shortcut CTRL + SHIFT + J on Linux or Windows, or COMMAND + OPTION + J on macOS, which will bring focus immediately to the Console.
What does console.log function do?
Console has a program that displays things on screen. This program is called log()
Since log() belongs to console we ask log to display things for us by calling console first, then a DOT, then the word log(): console.log();
Inside of the parentheses we add the things we want to display on screen, like for example: numbers: console.log(1234);
How can you change the contents of an HTML page through the console?
Insert a heading into the HTML, modify the style of the page such as the background color as well as the color for the text on the page. From here, you can create paragraph element. With this element created, you can then go on to create a text node that we can then add to the paragraph. Then add the text node by appending it to the variable p. And finally append p with its paragraph element and appended text node to the document. It is important to keep in mind that you’re not changing the HTML document when you do things on the Console. In this case, once you reload the page it will return to a blank document.