Easy Tutorial
❮ Prop Style Backgroundimage Prop Element Clientleft ❯

HTML DOM console.groupCollapsed() Method

Console Object

Example

Create a collapsed group of messages in the console:


Definition and Usage

The console.groupCollapsed() method is used to set up a collapsed group of messages. All output messages executed after this code will be within the collapsed group.

Click the expand button to open the group of messages.

Note: Use the console.groupEnd() method to end the current group.

Note: Use the console.group() method to set up an uncollapsed group of messages.


Syntax

console.groupCollapsed(label)

Browser Support

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

Method Chrome Edge Firefox Safari Opera
console.groupCollapsed() 6 11.0 9.0 5.1 Yes

Parameter Values

Parameter Type Description
label String Optional. The label for the group.

More Examples

Example

Use the console.groupEnd() method to end the group:

Example

Set a label for the group of messages:

Console Object

❮ Prop Style Backgroundimage Prop Element Clientleft ❯