Easy Tutorial
❮ Prop Source Media Jsref Bold ❯

HTML DOM console.group() Method

Console Object

Example

Create a group of messages in the console:


Definition and Usage

The console.group() method is used to set the start of a group of messages. All subsequent messages will be nested within this group.

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

Note: Use the console.groupCollapsed() method to hide the group of messages.


Syntax

console.group(label)

Browser Support

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

Method
console.group() Yes 11.0 4.0 4.0 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 Source Media Jsref Bold ❯