Console - Reading Assignment

  1. The console is used for manage JavaScript.
  2. ctrl+shift+j or ctrl+shift+i or f12.
  3. console.log logs information, instead showing a pop-up alert.
  4. You can modify an HTML file with different development tools, like DOM.
1 Like
  1. What is the console used for?
  • The console is built into most browsers so that you can check and test web pages using JavaScript
  1. How do you open the Console in Google Chrome?
  • Open the r dots on the top right hand side of a web page. Scroll down to More Tools and then open Developer Tools.
  1. What does console.log function do?
  • Various tests on a web page including complex mathematical problems or current date and time etc. In essence these functions act as a tool for running commands and seeing the results of those commands without interfering with the live web page.
  1. How can you change the contents of an HTML page through the console?
  • Log a DOM node to the console
  • Right click on it
  • Select Edit as HTML or Edit Text
1 Like
  1. used for development and testing code
  2. F12
  3. output info to the console.
  4. using the element tab
1 Like

Yes, the Elements tab in Chrome DevTools, for example… but also by writing JavaScript code in the console, JavaScript that accesses and manipulates the page’s Document Object Model (DOM)

1 Like

Great!
Just a couple of comments…

Rather than console.log() running commands or executing our program, it basically allows us to print/display on the screen (in the console) whatever value we define within the parentheses - which as you say can be a complex mathematical calculation or current date and time etc.

Do you mean using the Elements tab in Chrome DevTools, for example? Yes, we can do it there in the way that you describe :+1:
In the actual console we can do this by writing JavaScript code that accesses and manipulates the page’s Document Object Model (DOM).

2 Likes
  1. What is a console used for?

A console is used to make changes to an html document using JavaScript. It immediately shows the changes one makes without saving it directly to the document thus serving as a preview. In order to make the changes permanent, one has to save them.

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

a. Go to the three vertical dots in the top right hand corner; scroll down to “More Tools”; scroll down to “Developer Tools”.
b. Press ctrl+alt+j
c. Press F12

  1. What does the console.log function do?

It’s used to check whether your code is working as expected before adding it to the document.

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

By writing JavaScript code. You can add code or change existing code. Obviously you have to use the correct syntax otherwise errors will show.

1 Like
  1. The console can be used to log information as part of the JS development process, as well as allow you to interact with a webpage by carrying out JS extensions within the page’s content.

  2. Top-right menu > More Tools > Developer Tools. Or use F12.

  3. It allows us to make changes to a site without windows popping up.

  4. The contents can be modified in the console by modifying the ‘document’ object.

1 Like

Great! :slight_smile:

What language keyboard do you have? Instead of +alt it’s usually +shift…check and let me know :+1:

Yes…and more specifically JavaScript code that accesses and manipulates the page’s Document Object Model (DOM)

1 Like

Yes, you’re right that console.log() avoids having to use alert(). Rather than directly making changes to the web page, it helps us experiment with the JavaScript code by allowing us to display certain outputs in the console (whatever value we define within the parentheses).

2 Likes

1-The console is used to incorporate Javascript to manage the scripts, and for monitore youre code directly on the web browser.
2-you can use F12 or ctrl+shift+j.
3-logs out results into the JavaScript console
4- All the HTML elements are defined in the console as object.you can be access and modifie element
using JavaScript.

1 Like
  1. The console is a way to get a glimpse into the internal structure of the website you are on. You can also use JavaScript to make alterations.
  2. In Google Chrome, it is most easily opened by pressing Ctrl + Shift + J.
  3. The console.log function keeps track of information in the console.
  4. You use JavaScript code to interact with the HTML. All changes will be erased once you refresh the page though.
1 Like

1.The console is used to test, monitor and manage javascript on the loaded pages

  1. CTRL SHIFT J

3.Prints to console

4.By clicking element tab and double clicking on what you want to change

1 Like

Awesome. Appreciate the clarification Thanks Jon

1 Like
  1. The console provides the option to write,manage,and monitor JavaScript on command.

  2. Using the keyboard shortcut CTRL+SHIFT+J in Chrome Windows.

  3. Display the output of a JavaScript expression.

  4. Save the HTML file and load it into a browser. A blank page is displayed with the title of the page as
    today’s date. You can open up the console and begin working with JavaScript to modify the page.

1 Like

1- The console is used to program in real time, here you can write/manage/moniter.
2- CTRL+SHIFT+ I
3- logs information onto the console
4- By using javascript code you can modify a HTML page through the console using commands such as document.body.style.backgroundColor

1 Like
  1. The console is used for logging information during the development of JavaScript. It can also be used to interact with a web page through carrying out expressions in JavaScrips page context.

  2. You can open the console by clicking the 3 dots in the top right of the web browser and then click more tools, then developer tools. From there just click console in the top menu bar.

  3. It allows you to work with JavaScript by logging the inputs to the console of a web page.

  4. By inputting commands into the console in JavaScript using document.

1 Like

Hey @hoolie! Good answers :+1:

Yes, we can change the contents of an HTML page there :+1:
In the actual console, we can do this by writing JavaScript code that accesses and manipulates the page’s Document Object Model (DOM) .

1 Like

Great answers @Aidan! :+1:

Yes, this is called the Document Object Model (DOM), and as you say in your answer to question 4, to access and manipulate the page’s DOM we write JavaScript code that begins with document.

1 Like
  1. Console is used to directly interact with the web page.
  2. Right click -> Inspect.
  3. Executes code in console and outputs the result.
  4. After opening console, you have to find the Element window in which you can modify a content of HTML page.
1 Like

Yes, that’s right…and more specifically JavaScript code that accesses and manipulates the page’s Document Object Model (DOM).

1 Like