Using console.log()

It’s used for debugging purposes, we can use the console.log() method to display data.

Get Started With Running JavaScript In The Console

Checkout: https://developers.google.com/

Print Output: “Hello World” using Javascript Console.

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Console log()</title>
    <script type="text/javascript">

         console.log("Hello World!");
         console.log(101);
         
    </script>
  </head>
  <body>

  </body>
</html>

Output in Console Browser window:

Steps to go inspect element console:

  • Right-click anywhere on the webpage, and at the very bottom of the menu that pops up, you will see “Inspect.” Click that.
  • Click the hamburger menu (the icon with 3 stacked dots) on the far right of your Google Chrome toolbar, click More Tools, then select Developer Tools. Alternately, in the file menu, click View —> Developer —> Developer Tools.
  • Prefer keyboard shortcuts? Press CMD+Option+I on a Mac, or F12 on a PC to open Inspect Elements without clicking anything.

Leave a Reply

Your email address will not be published. Required fields are marked *