
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to Clear the JavaScript Console in Google Chrome
In this article we are going to learn how to clear the JavaScript Console in Google Chrome. We have various methods to clear the console; but our question is why do we need to clear the console?
Sometimes we have lots of commands and logs printed in any browser console which makes it look substandard and packed with output. So, we need to clear the console. And there are multiple ways to clear the console of google chrome.
Using the console.clear() method
This method will clear the console and display the message on the console that the console was clear.
Example
Following is the example of the console.clear() method −
<!DOCTYPE html> <html lang="en"> <body> <p>Please click the clear button to clear the console.</p> <button onclick="clearFunc()">clear</button> <script> function clearFunc() { console.clear(); } </script> </body> </html>
We can also use the keyboard to clear the console. (Ctrl + L)
We can also use the clear log button on the top left corner of the chrome dev tools console to clear the console.
in the following screenshot, we have marked a circle on the clear log button.
On the macOS we can use (Command + k) for clear the log.
- Related Articles
- How do I print debug messages in the Google Chrome JavaScript Console?
- How to call a JavaScript Function from Chrome Console?
- How to clear console in C?
- How to clear console in MongoDB?
- How do you launch the JavaScript debugger in Google Chrome?
- How to Install Google Chrome in Ubuntu
- How to set Google Chrome in WebDriver?
- How to use Google Chrome Virus Scanner?
- How to disable Google Chrome autofill option?
- How to Block Pop-Ups on Google Chrome?
- How to Automatically Generate Random Secure Passwords in Google Chrome?
- How can I clear console using C++?
- Ok google a google voice search on chrome beta
- Coolnovo a web browser similar to google chrome
- Now, Google+VMware Provide Services to Chrome OS
