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()
Example: Below program illustrates the console.groupEnd() method in HTML
html
<!DOCTYPE html>
<html>
<head>
<title>DOM console.groupEnd() Method</title>
<style>
h1 {
color: green;
}
</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>
|
Output:

Supported Browsers: The browsers are supported by the console.groupEnd() method is listed below:
- Google Chrome 2.0
- Edge 12.0
- Firefox 9.0
- Opera 11.0
- Safari 4.0
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!
Looking for a place to share your ideas, learn, and connect? Our Community portal is just the spot! Come join us and see what all the buzz is about!
Last Updated :
03 Aug, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...