< html‎ | elements
Jump to: navigation, search


This article is Not Ready.



The hgroup element (<hgroup>) is typically used to group a set of one or more h1-h6 elements — to group, for example, a section title and an accompanying subtitle. The hgroup element (<hgroup>) element is obsolete in HTML5.

Overview Table

DOM Interface HTMLElement


The following is an example of a valid heading. The hgroup masks the h2 element (which acts as a secondary title) from the outline algorithm.

 <h1>Dr. Strangelove</h1>
 <h2>Or: How I Learned to Stop Worrying and Love the Bomb</h2>

For document summaries and outlines, the text of hgroup elements is defined as the text of the highest ranked h1-h6 element descendant, or the first such element if there are multiple elements with the highest rank. If there are no such elements, then the text of the hgroup element is the empty string. The following script demonstrates how to implement this behavior.

function findHeadings(node)
    // First check if this node has an <hgroup>.
    var hg = node.getElementsByTagName("HGROUP");
        node = hg[0];
    // Now find the highest ranking heading.
    var ranks = [ "H1","H2","H3","H4","H5","H6" ];
    for (var i=0; i<ranks.length; i++) {
        var headings = node.getElementsByTagName(ranks[i]);
            return headings[0].textContent;
    // No headings present, return empty string.
    return "";



Windows Internet Explorer 9. The hgroup element is only supported for webpages displayed in IE9 Standards mode. For more information, see Defining Document Compatibility. The hgroup element is used to group a set of h1-h6 elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines. Other elements of heading content in the hgroup element indicate subheadings or subtitles.

Standards information

There are no standards that apply here.

HTML information




Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?


Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

See also

External resources


Related pages (MSDN)

  • Reference
  • article
  • aside
  • figcaption
  • figure
  • footer
  • header
  • mark
  • nav
  • section


This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]