HTML DOM Heading Object

Heading Object

The Heading object represents an HTML heading element: <h1> to <h6>.

Access a Heading Object

You can access a heading element by using getElementById():

Example

var x = document.getElementById(“myHeading”);

Try it Yourself »

Create a Heading Object

You can create a heading element by using the document.createElement() method:

Example

var x = document.createElement(“H1”);

Try it Yourself »

Heading Object Properties

Property Description
align Not supported in HTML5. Use style.textAlign instead.
Sets or returns the value of the align attribute of the heading element

Standard Properties and Events

The Abbreviation object supports the standard properties and events.

Post Author: Zahid Farid