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.

Syntax

console.clear();

Specifications

Specification Status Comment
Console API
The definition of 'console.clear()' in that specification.
Living Standard Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes1248 Yes Yes Yes
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support ? ? ?48 ? ? ?

See also

Document Tags and Contributors

Contributors to this page: fscholz, arronei, valtlai, erikadoyle, wbamberg
Last updated by: fscholz,