This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Kaushal Kishore
over 10 years

console.log() not working in my browser.

I wrote an HTML program with a Javascript code, with console.log() functions for printing, and ran it in the browsers(IE, Chrome) but found that nothing was being printed.

When I used document.write(), I was able to print.

Why isn’t console.log() working?

Answer 535ea4ed7c82cadca8000a71

1 vote

Permalink

The document.write() function writes the output straight to the screen but the console.log() outputs the result in the “console” of its browser.To be able to see the console output you should right click on the page and select inspect element and then go to the console tab(At least that’s what you do in Chrome).

points
over 10 years