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

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge Full support 12Firefox Full support 48IE Full support YesOpera Full support YesSafari Full support YesWebView Android ? Chrome Android ? Edge Mobile ? Firefox Android Full support 48Opera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown

See also

Document Tags and Contributors

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