THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

HTML DOM Header Object


Header Object

The Header Object is new in HTML5.

The Header object represents an HTML <header> element.

Note: 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():

Example

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

Create a Header Object

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

Example

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