2 min read
Internet Browser - Microsoft Edge was used in this demo
Explanations of Commands
Using the console.log() Command
As stated, the "console.log()" command only works when using the console in an Internet Browser. To find the console, open up an Internet Browser. On any tab, right-click and select "Inspect".
After clicking "Inspect", there are many options to choose from, including a "Console" option. By clicking the "Console" option, a shell appears that the user can interact with. Since this console shell is configured for the internet browser, running any commands will affect the browser directly or the web pages that it displays. Below is a full view of the Console in Microsoft Edge:
As shown it returns, "Hello".
Using the document.write() Command
<html> <head> <meta charset="UTF-8"> </head> <body> <script>document.write("Hello")</script> </body> </html>
After configuring and saving the HTML file, open the file. If successful, a blank page with the word "Hello" should appear: