What is the console used for?
Debug webpages. Tryout javascriptâŚ
How do you open the Console in Google Chrome?
Ctrl + Shift + i shortcut or Inspect Element menu item in popup menu fired on webpage and go to Console Tab. My favorite is F12 key.
What does console.log function do?
Prints strings, return of functions. Helps us debug the facts and consequesnces out of code. In basic example of a usage: console.log("Hello, world!");
output: Hello, world.
console.log(2^2);
output: 4
console.log("2 times 0 = " + 2*0 );
output: 2 times 0 = 0
How can you change the contents of an HTML page through the console?
On the webpage, get to the content with mouse; right click; Inspect Element, then in Elements Console Tab double-click on the selected DOM elementâs content between opening and closing tags or right click on the element and select Edit as HTML
command in popup menu brings us to edit the content.