Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM console.clear() method

HTML DOM console.clear() method

Console Object Console object

Example

Clear all information on the console:

console

.

clear

(

)

;

Try it »


Definition and Usage

The console.clear() method is used to clear all information on the console.

After the console.clear() method executes successfully, it outputs "Console was cleared" on the console.


Syntax



console.clear()


Browser support

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

Method
console.clear() Yes Yes 48 Yes Yes

Console Object Console object