HTML DOM Header Object

Header Object

The Header Object is new in HTML5.

The Header object represents an HTML <header> element.

注: The <header> element is not supported in Internet Explorer 8 and earlier versions.

Access a Header Object

You can access a <header> element by using getElementById():


var x = document.getElementById("myHeader");
Try it Yourself »

Create a Header Object

You can create a <header> element by using the document.createElement() method:


var x = document.createElement("HEADER");
Try it Yourself »

Standard Properties and Events

The Header object also supports the standard properties and events.

Related Pages

HTML tutorial: HTML5 Semantic Elements

HTML reference: HTML <header> tag

JavaScript reference: HTML DOM Footer Object