Php Php
Php Php

Reputation: 127

How can I see the output of console.log()?

I am using this code:

<script type = "text/javascript">
 console.log("hello world");
</script>

How can I see the output of console.log()?

I searched on Google but did not find a solution.

Upvotes: 6

Views: 60350

Answers (8)

sohel khalifa
sohel khalifa

Reputation: 5578

The console.log(); statement prints anything in the browser console.

Look for Developer Tools or Simply Tools menu in all major browsers.

If you are using Google Chrome the press Cntrl+shift+j to see console.

In Firefox, press Ctrl+Shift+I and click on Console to view the console on Firefox.

Upvotes: 4

Vrushali Gave
Vrushali Gave

Reputation: 13

For Chrome browser follow these steps:

  1. click on More tools on the right side of the top
  2. click on Developer tools
  3. click on console

Upvotes: -1

Alka pandey
Alka pandey

Reputation: 1

You can add a chrome extension named "console log viewer" and then you can see the logs even without opening the developer tool

Upvotes: -1

looper
looper

Reputation: 1979

You can open the error console, depending on your browser. (Ctrl+Shift+J in Firefox, or F12 in Chrome, for example). Most browsers have the console hidden in their developer tools.

Upvotes: 7

Jezen Thomas
Jezen Thomas

Reputation: 13800

You need to view the result in the console. Open the console.

Also, you have a problem with your code.

<script type = "text/javascript">
console.log("hello world");
</script>

Is not valid. Remove the spaces in the script tag, like this:

<script type="text/javascript">
console.log("hello world");
</script>

Upvotes: 2

Jhonathan H.
Jhonathan H.

Reputation: 2713

first of all console.log() of javascript cannot be outputed in your..

you need the javascript console to output it

first

press F12 then click the console label

before refreshing the browser to see your output..

but if your console.log() alternatives for browser is document.write();

Upvotes: -1

polin
polin

Reputation: 2845

  1. Open firefox
  2. Go to tools and then add-on.
  3. Search and install an add-on named "firebug"
  4. before reloading your page open firebug and go to console tab.
    You will see your desired result. If you have chrome then its already there. just use it

Upvotes: -1

arrest warrant
arrest warrant

Reputation: 354

press F12 in google chrome and click on console to see the output

Upvotes: 0

Related Questions