HTML DOM Div Object

Div Object

The Div object represents the HTML <div> element.

Access Div Object

You can use getElementById() to access the <div> element:

var x = document.getElementById("myDIV");

Try It Yourself

Create Div Object

You can use the document.createElement() method to create a <div> element:

var x = document.createElement("DIV");

Try It Yourself

Div Object Properties

Properties Description
align

Not supported in HTML5.Please use style.textAlign.

Sets or returns the value of the align attribute of the <div> element.

Standard Properties and Events

Div Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Tutorial:HTML Block

HTML Reference Manual:HTML <div> Tag