Console - Reading Assignment

  1. What is the console used for?
  • The console allows you to interact with a web page by carrying out JavaScript expressions within the page’s context.
  1. How do you open the Console in Google Chrome?
  • Open the menu at the top right corner of the browser, select More Tools then Developer Tools. Then click on Console
  1. What does console.log function do?
  • Rather than have pop-up alerts that we need to continue to click out of, we can work with JavaScript by logging it to the Console with console.log.
  1. How can you change the contents of an HTML page through the console?
  • The Console provides you with a space to experiment with modifying HTML pages, but 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.
2 Likes

1- The console can be used to log information as part of Javascript development process, as well as allow you to interact with a web page by carrying out javascript expressions within the pages context. The console provides you with the ability to write, manage and monitor Javascript on demand.
2- Menu/moretooles/developertools/console or using the keyboard shortcuts COMMAND+OPTION+J.
3- The console.log() is a function that writes a meesage to log on the debugging console. In a browser you will not see anything on the screen. It logs a message to a debbuging console… If your browser supports debbuging, you can use the console.
4- The console provides you with a space to experiment with modifying HTML pages, but it is important to keep in mind that you are not changing the HTML document when you do things on the console. In this case when you reload the page it will return to a blank document.

2 Likes
  1. testing and debugging code
  2. three dots>More tools>Developer tools
  3. send output to the console
  4. by entering document element text in the console
2 Likes
  1. What is the console used for?
    To monitor and write JS, to log information when you are developing in JS; to execute JS functions in the context of the page.

  2. How do you open the Console in Google Chrome?
    F12

  3. What does console.log function do?
    Evaluates an expression and logs the return value into the console. E.g. console.log(Date()); returns the current date and time.

  4. How can you change the contents of an HTML page through the console?
    You can use JS to access HTML elements, e.g. document.body.innerHTML = “Hey!”; would change the contents of the body of the HTML document to Hey!

2 Likes
  1. The console is used to interact with a html page by writing JavaScript code directly to it.
  2. More tools>Developer tools
  3. console.log function is used to print (display) any kind of variable defined previously or a message.
  4. You’d have to use the DOM inspector.
2 Likes

Hi all,

I was looking for the answer in StackOverflow, but didn’t get help on this one.

How do you erase and/or insert a line of script if a buggin’ debugger has pointed one out?

My efforts thus far have seemed to exacerbate the problem:

2 Likes
  1. The console is used for writing code in a test environment; you can write code and it will temporarily effect the very website instance you are attending. However, when the page is refreshed all coding completed in the console will disappear and no longer effect webpage.

  2. You may open the Console page in Google Chrome by going to the upper right corner where the 3 verticle dots are>more tools>Developer Tools and you’ll happen upon the Console.

  3. The console.log function allows you to get results from coding on the console rather than the webpage.

  4. You can change the HTML page only temporarily through the console (according to the article) and from the DOM panel a.k.a inspector in Firefox and Elements in Chrome. You write code directly into the blank page in Console and it effects the webpage, if you are experimenting and are more interested in results along with possible error messages, you opt for the console.log command so the results will appear on the console only as explained above.

In fact, it begs the question: Can you actually change the webpage through the console? I’m thinking there must be a way web developers do everyday, so I looked it up:

To edit the page *type this code (I didn’t tell you to do it!):

javascript:document.body.contentEditable=‘true’;document.designMode=‘on’;void 0

*https://www.instructables.com/Edit-any-website-or-webpage-permanently/

2 Likes
  1. The Console provides you with the ability to write, manage, and monitor Javascript on demand.

  2. To access The Console from Google Chrome on Mac = option+command+j

  3. The console.log function logs info within the Console.

  4. You can change the contents of an HTML page through the Console by using the document command.

2 Likes
Console Reading Assignment


1. Console allows you to write JS. It can be used to log information as well. It lets you put in JS expressions in the pages content meaning to have things like pop ups that give messages to the page visitor.
2. Click the three dots>more tools>dev tools then click Console or by holding CTRL+Shift+J
3. Instead of having a pop-up that needs to be clicked off it allows the webisite to have the pop up logged to the console.
4. By using the inspector/elements panel in firefox/chrome. This allows you to view and/or edit the DOM which shows the HTML.
2 Likes
  1. The Console provides you with the ability to write, manage, and monitor JavaScript on demand within a website in real time
  2. Menu > More Tools > Developer Tools
  3. With console.log you don’t get pop-up windows that you have to click on to get rid of, it returns the answer within the console itself
  4. It’s a chance to test your modifications like the contents, the style (page colour for instance) etc. This does not permanently alter the code though, upon refreshing it reverts back to the original site.
2 Likes

Hey @Eva, hope you are great.

The console’s erro are a guide for the change that you can made in the main file. Remember that if you are typing code directly to the console, it will be lost after each time you refresh the page.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like

Hi @thecil , l know the coding disappears when the website is refreshed, but what I’m asking is how, if you skip a line of intended code, do you insert it and also how do you delete the lines and if you can delete the lines.

I do realize you refer to a line and it repeats itself so you can correct it, but it seems when I added a line that I got an error on for omitting, it didn’t acknowledge my addition of the line.

So, what you’re saying is that I can call up a previous line to correct it and add a line after getting errors, but I cannot go back up in the code to delete or insert lines, I believe that is what you mean.

In any event, I can always refresh the page and do it again, it is just that I was looking for a way that my work wouldn’t have to be deleted in its entirety due to one omission of a line! :face_with_raised_eyebrow:

1 Like

Yes, through the main file, not the console. I never code directly on the console. for that reason, it is a mess to correct a previous code line, I prefer to write a js file and then use the console to debug.

Carlos Z

2 Likes
  1. The console is used for logging information and interacting with a webpage using Javascript.
  2. Control + shift + j, or click the control panel, select “more tools”, select “developer tools”
  3. The console.log function will print previously defined variables or any message that needs to be displayed to the user.
  4. By using the elements tab.
2 Likes
  1. What is the console used for?
    The console provides you with a space to experiment with modifying HTML pages and try out JavaScript code in real time, but it is important to keep in mind that you’re not changing the HTML document when you do things on the Console. Once you reload the page it will return to the previous document.

  2. How do you open the Console in Google Chrome?
    To open 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 will open a panel where you can click on Console along the top menu bar.

  3. What does console.log function do?
    The console.log is a function in JavaScript which is used to print any kind of variables defined before in it or to just 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?
    By using the document. object

2 Likes
  1. What is the console used for?
    It’s used to log information as well as JavaScript development process. It provides the ability to write, control and manage JavaScript on demand.

  2. How do you open the Console in Google Chrome?
    By clicking on Menu, then selecting More tools, then Developer tools, then Console.

  3. What does console.log function do?
    Can be used for calculations, you put an input, you receive a different output.

  4. How can you change the contents of an HTML page through the console?
    The console provides the possibility to modify an HTML pages, like the background color, the style of the page, but always you need to save before refreshing, otherwise you will loose the modifications.

2 Likes

1.The Console provides you with a space to experiment with modifying HTML pages, but 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.

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. The console can also be opened by clicking the F12 or also on Mac = OPTION + COMMAND + J
3. A console is a sandbox where you can test your code to see if it works.
4. (On Mac) Wghen you open the consol, you choose Elements and then double click on the content that you want to change. Bear in mind that if you reload the page you’ll return to the saved state of the HTML document.

1 Like
  • The console is a tool which lets the user edit code on demand and more easy find errors in many lines of code
  • The console can be accessed by pressing ctrl+shift+J, the F12 button will also take you there
  • The console.log function directs the output of a command to the console window
  • By using the element function tool. Dont forget to save any new changes ^^
1 Like

The browser console is used to write, manage, and monitor JavaScript on demand.

To open the JavaScript Console in Chrome, navigate to the menu at the top-right of your browser and clickon the three vertical dots.
From there, you can select More Tools then Developer Tools.

Console provides you with a space to try out JavaScript code in real time by letting you use an environment similar to a terminal shell interface

Change the contents of an HTML page through the console by coding JS to the document innerhtml.

1 Like
  1. What is the console used for?
    The console is used for writing, managing, and monitoring javascript on demand.

  2. How do you open the Console in Google Chrome?
    click on the 3 dots, more tools, developer tools, then click on the console tab

  3. What does console.log function do?
    allows JavaScript to run in console

  4. How can you change the contents of an HTML page through the console?
    You can look at the DOM through JavaScript

1 Like