Console - Reading Assignment

1. What is the console used for?

The console is a command line environment for javascript. It will log outputs of currently running scripts in the browser and interpret any code you enter and display the result.

2. How do you open the Console in Google Chrome?
  • Click the “…” > More Tools > Developer Tools
  • Also in most browsers the keyboard shortcut is F12
3. What does console.log function do?

It outputs (logs) text to the console

4. How can you change the contents of an HTML page through the console?
  • You can change the contents programmatically by creating elements using document.createElement() and appending them manually into the DOM or by modifying existing elements.
  • You can also use the “Inspector” tab (the “Elements” tab in Brave) to view the DOM and edit it directly in a visual way by selecting with the mouse and typing
1 Like

1.Console is used to edit the webpage in real time. All edits made are only temporary and is mainly used to test code to see how it looks.
2. click 3 dots. more tools, developer tools.
3.console.log function executes the code within the console instead of the website.
4.You can change the contents through the Elements tab on google chrome by clicking on the code itself and changing it.

1 Like
  1. The Console used for carrying out JavaScript expressions within the page’s context during the JavaScript development process.
  2. Ctrl+Shift+I (or right mouse click / Inspect)
  3. Logging the expressions to the Console
  4. Right mouse click / Inspect
1 Like
  1. To log information about the ongoing JavaScript functions that you have implemented.
  2. Top right control menu > More Tools > Developer Tools, for quicker access; win or linux: ctrl + shift + j, Mac: cmd + option + j
  3. It logs pop-up alerts to the console
  4. right klick on element and choose inspect
1 Like
  1. What is the console used for?
    The Console 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.

  2. How do you open the Console in Google Chrome?
    You may look through the menu of the browser and look for Developer tools or use the keyboard shortcut:
    Windows/Linux: CTRL + SHIFT + j

  3. What does console.log function do?
    It enables the console to show the result of a piece of javascript code in real time.

  4. How can you change the contents of an HTML page through the console?
    You can use JavaScript to insert things into the HTML such as a new background colour using the code document.body.style.backgroundColor =“lightblue”;

Inserting this into the HTML will change the background of the webpage to lightblue and you will see this change on-screen but you’re not changing the HTML document when you do things within the Console. When you reload the page it will return to the way it was before.

1 Like

1. What is the console used for? The JavaScript Console provides users with a space to try out JavaScript code in real time by letting them use an environment similar to a terminal shell interface.

2. How do you open the Console in Google Chrome? To enter into the JavaScript Console simply use the keyboard shortcut CTRL + SHIFT + J on Linux or Windows, or COMMAND + OPTION + J on macOS.

3. What does console.log function do? The console.log() is a function in JavaScript that is used to print any message that needs to be displayed to the user.

4. How can you change the contents of an HTML page through the console? You can change the contents of an HTML page through the elements tab in the console.

1 Like
  1. It’s used to write and monitor Javascript in a browser.
  2. Tripple dot menu - Web programmer - Web console
  3. Puts info to the console
  4. Using the elements tab in console
1 Like

The console of your web browser can be used to develop and interact with a web page using javascript
CTRL+SHIFT+J
control.log logs a value output
By using the document element in the console

1 Like
  • What is the console used for?
  • The Console 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?
  • To opet the Javascript Console in Chrome, you can navigate to the menu at the top-right of your browser window signified by three vertical dots in a row. More Tools – > Developer tools . This should open Elements for you, and then along that line you should se Console option, or there is alternative for Linux and Windows it is CTRL + SHIFT + J , and for macOS it is COMMAND + OPTION + J .
  • What does console.log function do?
  • It is logging our Javascript in to the Console.

  • How can you change the contents of an HTML page through the console?
  • When we open our HTML page in the web browser we can open then console on the web find content that we would like to change, double click it and it will allow us to modify it.
1 Like
  1. The console is used for temporarily editing a webpage. It has the format of a terminal or cmd window
  2. You can use the shortcut Ctrl+Shift+I and navigate the panel
  3. console.log allows you to print/output a pre-determined variable or perform calculations
  4. To change the content of an HTML page we have use document.body property:
  • Define an element
  • Define the content
  • Append the content to the element
  • Append the element to the body
  1. What is the console used for?

Testing how certain code will react in a browser.

  1. How do you open the Console in Google Chrome?

In Developer Tools or CMD+Opt+J

  1. What does console.log function do?

logs the given function to the console.

  1. How can you change the contents of an HTML page through the console?

This one was a bit more elusive for me and I have yet to understand it.

1 Like

What is the Console? - a development too by a web browser to be able to work with JS

  1. What is the console used for?

A console can be used to log information as part of the JavaScript development process, as well as allow interaction with a web page by carrying out JavaScript expressions within the page’s context. Essentially, the Console provides the ability to write, manage, and monitor JavaScript on demand.

  1. How do you open the Console in Google Chrome?

Navigate to the menu at the top-right of Chrome window signified by three vertical dots in a row. From there, select More Tools then Developer Tools. This will open a panel, then click on Console along the top menu bar to bring up the JavaScript Console.

Or you can also enter into the JavaScript Console by 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.

On Mac Air, simply click the View tab, scroll down to the Developer tab, then click Javascript console.

  1. What does console.log function do?

The console . log () is a function that writes a message to log on the debugging console , such as Webkit or Firebug. In a browser you will not see anything on the screen. It logs a message to a debugging console.

The Console method log() outputs a message to the web console. The message may be a single string (with optional substitution values), or it may be any one or more JavaScript objects.

  1. How can you change the contents of an HTML page through the console?
    The DOM node context menu, which you may recognize from the elements panel, is also present in the console panel.

  2. Log a DOM node to the console.

  3. Right click on it.

  4. Select Edit as HTML or Edit Text.

  5. Notice the DOM is updated on the page and also in the Elements Panel.

1 Like
  1. A console is used within the web browser to apply javascript code inside of the actual webpage.
  2. Menu>More tools>Developer tools>Console
  3. A way of logging date into the console. Result is an output.
    4.By using the document element within the console.
1 Like
  1. What is the console used for?
    It’s used for testing js on a web page without actually changing the page. It’s also useful for testing expressions and other small code snippets.
  2. How do you open the Console in Google Chrome?
    One way is to right-click an a web page and chose Inspect.
  3. What does console.log function do?
    It outputs stuff to the console, it can be strings, expressions, returns from funktions and a lot of other things.
  4. How can you change the contents of an HTML page through the console?
    By double-clicking the code under the Elements tab.
1 Like

4. How can you change the contents of an HTML page through the console?

After the website is loaded, open the console and it will appear a lot of the website’s html content, we can modify this content to make change on it without rewrite the DOM (Document Object Model) of the website.

If we want to made those change permanently, we have to write those changes in the html main file of the website outside the console (In a IDE like Atom).

Hope this gives you a clear view of the subject, keep learning! :slight_smile:

Carlos Z.

Excellent answer sir! really well documented! keep it like that please! :muscle:

Carlos Z.

  1. To add dynamic content to a webpage or to debug it
  2. Top right corner below x, more tools, Dev tools
  3. It displays whatever comes next
  4. By using the line document.body.innerHTML = …
    you can insert html from JS.
1 Like
  1. To manage and monitor Javascript. in real time in real environment
  2. Menu<more tools< developing tools
  3. It’s used to show results in console panel. you can also do complicated things like math and other operations.
  4. by adding javascript code into html code
1 Like
  1. Log info as as part of JavaScript development and interact with webpage.
  2. Ctrl+Shift+J
  3. Allows for testing code in real time.
  4. You may not.

1- the console is used to try/test your code and have an easy/quick preview of what the output would be

2- open a browser, press the three buttons at the top right, select more tools for developers and select the Console sheet.

3- it logs info in the javascript console

4- you can interact with the pages DOM using the “document” object

1 Like