HTML | DOM console.groupEnd() Method

The console.groupEnd() method in HTML is used to indicate the end of a group of messages in the console which has been created using the console.group() method. This method does not accept any parameter.

Syntax:

console.groupEnd()

Below program illustrates the console.groupEnd() method in HTML:

Example:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head
        <title>DOM console.groupEnd() Method</title
        <style
            h1 { 
                color:green; 
            
            h2 {
                font-family: Impact;
            }
            body { 
                text-align:center; 
            
        </style
    </head>
    <body>
        <h1>GeeksforGeeks</h1
        <h2>DOM console.groupEnd() Method</h2
        <p>To view the message in the console press the F12
        key on your keyboard.</p>
        <script>
            console.log
            ("GeeksforGeeks offers the following courses:");
            console.group("Courses");
            console.log("1. fork python");
            console.log("2. fork cpp");
            console.log("3. fork java");
            console.log("4. Interview preparation");
            console.groupEnd();
            console.log("GeeksforGeeks offers tutorials on the " +
            "following data structures :");
            console.group("Data Structures");
            console.log("1. Array");
            console.log("2. Linked List");
            console.log("3. Stack");
            console.log("4. Queue");
            console.groupEnd();
        </script>
    </body>
</html>                    

chevron_right


Output:

Console View:

Supported Browsers: The browser supported by console.groupEnd() method are listed below:

  • Google Chrome
  • Internet Explorer 11.0
  • Firefox 4.0
  • Opera
  • Safari 4.0


My Personal Notes arrow_drop_up

I am a technology enthusiast who has a keen interest in programming I am pursuing Engineering in Computer Science from GEU, Dehradun I like to unwind by watching movies and English sitcomsI have a keen interest in music

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.