This forum is now read-only. Please use our new forums! Go to forums
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
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).
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency