HTML DOM console.clear() Method

Definition and Usage

The console.clear() method clears the console.

The console.clear() method will also write a message in the console: "Console cleared".

Instance

Clear all messages from the console:

console.clear();

Try It Yourself

Syntax

console.clear()

Browser Support

The numbers in the table indicate the first browser version that fully supports this method.

Method Chrome IE Firefox Safari Opera
console.clear() Support Support 48 Support Support