Hi @Tordek!
Nice answers
Just to add to your Q4 answerâŚ
⌠and more specifically, by writing JavaScript code that accesses and manipulates the pageâs Document Object Model (DOM) .
Hi @Tordek!
Nice answers
Just to add to your Q4 answerâŚ
⌠and more specifically, by writing JavaScript code that accesses and manipulates the pageâs Document Object Model (DOM) .
Hi @Steffen,
Nice answers
Yes, we can change the contents of an HTML page there But this is a different developer tool.
In the actual console, we can do this by writing JavaScript code that also accesses and manipulates the same DOM.
The console serves a few functions but two stand out, the writing code & checking of code(debug). This can all be done from any standard web browser.
sticking with our binary theme one has two main options. Smashing F12 like the like button đ or menu(aka 3 dots)->more tools->dev tools->console. Annd heres another pair if your a windows mouse user right click any element and select inspect or hit ctrl+SHIFT+j simultaneously. Theres a few more. Some are mac specific and I'll leave those for jobites. Lol
javascript is stacked (integrated? )with html. It will recognize all the commands. Select an element and code away!
What is the console used for?
Console provides user the ability to write, manage, and monitor JavaScript when needed.
How do you open the Console in Google Chrome?
In Brave browser: right top corner â hamburger menu â more tools â developer tools.
What does console.log function do?
Console.log outputs to console which allows us to see the result inside the console.
How can you change the contents of an HTML page through the console?
By using JavaScript commands inside the console allows us to edit the HTML page.
console is a synonym for shell which is the interface to view services programmed by JS
F12
a command to record the execution of code for inspection
you cannot. the browser is to execute and view code, and editor like Atom alters it or writes new code altogether or takes away.
document.'section'.'function/attribut' = 'value';
The console is used for many purposes;
Console.log() operates like a Terminal Emulator and will in real time return results of commands entered into it in a similar fashion.
You can use javascript functions such as âelement.writeInto()â to write directly into an existing page element or you can create elements on the fly using built in functions such as document.createElement(), document.createTextNode() and **document.appendChild() to insert the new element into the page.
Nice answers, @Long
Yes, we can change the contents of an HTML page there But this is a different developer tool.
In the actual console, we can do this by writing JavaScript code that also accesses and manipulates the same DOM.
Hi @John_Okoye,
âŚbut you can change the contents of an HTML page temporarily via the console â by writing JavaScript code which accesses and manipulates the pageâs Document Object Model (DOM). However, these changes are not permanent and are just for web developers to test and experiment with how new JavaScript code, or modifications to the existing code, will affect a particular web page when run in the browser.
appreciated, did you learn that in a book? lol, just kiddingâŚI get it now, I think. DOM is the GUI of CLI (console) in heirarchy view? A higher abstract layer of the underlying code?
What is the Console used for?
How do you open the Console in Google Chrome?
What does console.log function do?
How can you change the contents of an HTML page through the Console?
Excellent answer sir! really well documented! keep it like that please!
Carlos Z.
Yes, in the uncompressed version (War and Peace)
That sounds like a good way to conceptualise it, yes. As its name suggests, the Document Object Model is a representation of our HTML document in objects. These objects allow dynamic interaction with the web page using a scripting language such as JavaScript. When we interact with the DOM using the console in Chrome DevTools we arenât changing the web pageâs actual code â I guess it just becomes like a parallel dimension which we get to run wild in and experiment with all we like, safe in the knowledge that when the page is reloaded our experimental reality will have vanished.
However, we can also write JavaScript that manipulates and interacts with the DOM within programs developed for web pages hosted live. Itâs by interacting with the DOM that JavaScript can turn static web 1.0 pages into dynamic 2.0 ones. We can also use jQuery to access and manipulate the DOM, but the syntax is a bit different.
1: The console is used for interacting with web pages by using JavaScript language. The console lets you write, manage and monitor JavaScript whenever you want.
2: CTRL+SHIFT+J
3: console.log prints the data that has been written inside the ()
4: By loading a HTML file into a browser and then opening console.