clear()

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Clears the console.

The Console's contents will be replaced with an informational message like "Console was cleared".

Note that in Google Chrome, console.clear() has no effect if the user has selected "Preserve log upon navigation" in the settings.

SyntaxEdit

console.clear();

SpecificationsEdit

Specification Status Comment
Console API
The definition of 'console.clear()' in that specification.
Editor's Draft Initial definition

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 48.0 (48.0) (Yes) (Yes) (Yes)
Available in workers ? ? ? ? ?

See alsoEdit

Document Tags and Contributors

 Contributors to this page: wbamberg
 Last updated by: wbamberg,